diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/src/promise.js b/src/promise.js index <HASH>..<HASH> 100644 --- a/src/promise.js +++ b/src/promise.js @@ -4,6 +4,11 @@ var $$iterator, ArrayIteratorPrototype; + // don't trample native promises if they exist + if ( 'Promise' in global && typeof global.Promise.all === 'function' ) { + return; + } + // set a value as non-configurable and non-enumerable function defineInternal ( obj, key, val ) { Object.defineProperty(obj, key, {
Don't trample native Promise if it exists
diff --git a/src/run.py b/src/run.py index <HASH>..<HASH> 100644 --- a/src/run.py +++ b/src/run.py @@ -16,7 +16,7 @@ import rnn_ctc #import datasets.kunwinjku #import datasets.timit #import datasets.japhug -import datasets.babel +#import datasets.babel from corpus_reader import CorpusReader
Removed Babel import to run.
diff --git a/src/test/java/org/mockito/internal/exceptions/stacktrace/StackTraceFilterTest.java b/src/test/java/org/mockito/internal/exceptions/stacktrace/StackTraceFilterTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/mockito/internal/exceptions/stacktrace/StackTraceFilterTest.java +++ b/src/test/java/org/mockito/internal/exceptions/stacktrace/StackTraceFilterTest.java @@ -26,7 +26,20 @@ public class StackTraceFilterTest extends TestBase { assertThat(filtered, hasOnlyThoseClasses("MockitoExampleTest")); } - + + @Test + public void shouldFilterOutByteBuddyGarbage() { + StackTraceElement[] t = new TraceBuilder().classes( + "MockitoExampleTest", + "org.testcase.MockedClass$MockitoMock$1882975947.doSomething(Unknown Source)" + ).toTraceArray(); + + StackTraceElement[] filtered = filter.filter(t, false); + + assertThat(filtered, hasOnlyThoseClasses("MockitoExampleTest")); + } + + @Test public void shouldFilterOutMockitoPackage() { StackTraceElement[] t = new TraceBuilder().classes(
Add test for removal of ByteBuddy stacktrace elements
diff --git a/src/SilexCMS/Set/DataSet.php b/src/SilexCMS/Set/DataSet.php index <HASH>..<HASH> 100644 --- a/src/SilexCMS/Set/DataSet.php +++ b/src/SilexCMS/Set/DataSet.php @@ -37,7 +37,7 @@ class DataSet implements ServiceProviderInterface public function filter(Response $resp) { if ($resp instanceof TransientResponse) { - if ($resp->getTemplate()->hasBlock($this->name)) { + if ($resp->getTemplate()->hasBlock($this->block)) { $repository = new GenericRepository($this->app['db'], $this->table); $resp->getVariables()->{$this->block} = $this->app[$this->block] = $repository->findAll(); }
Fixes a variable name (again)
diff --git a/app/models/resource.rb b/app/models/resource.rb index <HASH>..<HASH> 100644 --- a/app/models/resource.rb +++ b/app/models/resource.rb @@ -9,6 +9,8 @@ class Resource < ActiveRecord::Base def write_to_disk(up) begin + # create the public/files dir if it doesn't exist + FileUtils.mkdir(fullpath('')) unless File.directory?(fullpath('')) if up.kind_of?(Tempfile) and !up.local_path.nil? and File.exist?(up.local_path) File.chmod(0600, up.local_path) FileUtils.copy(up.local_path, fullpath)
Fix resource upload when dir doesn't exist. (closes #<I>) git-svn-id: <URL>
diff --git a/src/middleware/api.js b/src/middleware/api.js index <HASH>..<HASH> 100644 --- a/src/middleware/api.js +++ b/src/middleware/api.js @@ -1,5 +1,6 @@ import axios from 'axios' -import { canUseDOM } from 'fbjs/lib/ExecutionEnvironment'; +import { canUseDOM } from 'fbjs/lib/ExecutionEnvironment' +import invariant from 'fbjs/lib/invariant' function getUrl(path) { if (path.startsWith('http') || canUseDOM) { @@ -28,13 +29,15 @@ export default store => next => action => { const { types, ...rest } = callAPI - if (!Array.isArray(types) || types.length !== 3) { - throw new Error('Expected an array of three action types.') - } + invariant( + Array.isArray(types) || types.length !== 3, + 'middleware/api(...): Expected an array of three action types.' + ) - if (!types.every(type => typeof type === 'string')) { - throw new Error('Expected action types to be strings.') - } + invariant( + types.every(type => typeof type === 'string'), + 'middleware/api(...): Expected action types to be strings.' + ) const [requestType, successType, failureType] = types
use invariant to assert state shape in middleware
diff --git a/distributed/src/test/java/com/orientechnologies/orient/server/distributed/DistributedSecurityTest.java b/distributed/src/test/java/com/orientechnologies/orient/server/distributed/DistributedSecurityTest.java index <HASH>..<HASH> 100755 --- a/distributed/src/test/java/com/orientechnologies/orient/server/distributed/DistributedSecurityTest.java +++ b/distributed/src/test/java/com/orientechnologies/orient/server/distributed/DistributedSecurityTest.java @@ -56,8 +56,8 @@ public class DistributedSecurityTest extends AbstractServerClusterTest { try { // TRY DELETING ALL OUSER VIA COMMAND - g.command(new OCommandSQL("delete from OUser")).execute(); - Assert.assertTrue(false); + Long deleted = g.command(new OCommandSQL("delete from OUser")).execute(); + Assert.assertEquals(deleted.longValue(), 0l); } catch (Exception e) { Assert.assertTrue(true); }
Fixed test case according to the restricted visibility of reader/writer on OUser class/cluster
diff --git a/mbdata/replication.py b/mbdata/replication.py index <HASH>..<HASH> 100644 --- a/mbdata/replication.py +++ b/mbdata/replication.py @@ -245,7 +245,7 @@ def load_tar(filename, db, config, ignored_schemas, ignored_tables): logger.info("Skipping %s (table %s already contains data)", name, fulltable) continue logger.info("Loading %s to %s", name, fulltable) - cursor.copy_expert(f'COPY {fulltable} FROM STDIN', tar.extractfile(member)) + cursor.copy_expert('COPY {} FROM STDIN'.format(fulltable), tar.extractfile(member)) db.commit()
Make the changes compatible with python2
diff --git a/example/api.py b/example/api.py index <HASH>..<HASH> 100644 --- a/example/api.py +++ b/example/api.py @@ -1,4 +1,4 @@ -from flaskext.rest import RestAPI, RestResource, UserAuthentication +from flaskext.rest import RestAPI, RestResource, UserAuthentication, AdminAuthentication, RestrictOwnerResource from app import app from auth import auth @@ -6,12 +6,25 @@ from models import User, Message, Relationship user_auth = UserAuthentication(auth) +admin_auth = AdminAuthentication(auth) + +# instantiate our api wrapper api = RestAPI(app, default_auth=user_auth) + class UserResource(RestResource): - exclude = ('password',) + exclude = ('password', 'email',) + + +class MessageResource(RestrictOwnerResource): + owner_field = 'user' + + +class RelationshipResource(RestrictOwnerResource): + owner_field = 'from_user' -api.register(Message) -api.register(Relationship) -api.register(User, UserResource) +# register our models so they are exposed via /api/<model>/ +api.register(User, UserResource, auth=admin_auth) +api.register(Relationship, RelationshipResource) +api.register(Message, MessageResource)
Cleaning up the example app's API
diff --git a/blimpy/file_wrapper.py b/blimpy/file_wrapper.py index <HASH>..<HASH> 100644 --- a/blimpy/file_wrapper.py +++ b/blimpy/file_wrapper.py @@ -9,7 +9,10 @@ import h5py from astropy.coordinates import Angle -from . import sigproc +try: + from . import sigproc +except: + import sigproc # import pdb;# pdb.set_trace() diff --git a/blimpy/filterbank.py b/blimpy/filterbank.py index <HASH>..<HASH> 100755 --- a/blimpy/filterbank.py +++ b/blimpy/filterbank.py @@ -21,14 +21,9 @@ TODO: check the file seek logic works correctly for multiple IFs """ -import os + import sys -import struct -import numpy as np -from pprint import pprint -from astropy import units as u -from astropy.coordinates import Angle from astropy.time import Time import scipy.stats from matplotlib.ticker import NullFormatter
Removing unused imports and adding fail-over for non-package usage
diff --git a/src/main/java/com/hubspot/jinjava/lib/tag/SetTag.java b/src/main/java/com/hubspot/jinjava/lib/tag/SetTag.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/hubspot/jinjava/lib/tag/SetTag.java +++ b/src/main/java/com/hubspot/jinjava/lib/tag/SetTag.java @@ -64,6 +64,13 @@ import org.apache.commons.lang3.StringUtils; code = "{% set var_one = \"String 1\" %}\n" + "{% set var_two = \"String 2\" %}\n" + "{% set sequence = [var_one, var_two] %}" + ), + @JinjavaSnippet( + desc = "You can set a value to the string value within a block", + code = "{% set name = 'Jack' %}\n" + + "{% set message %}\n" + + "My name is {{ name }}\n" + + "{% end_set %}" ) } )
Add code snippet for set block
diff --git a/core/IP.php b/core/IP.php index <HASH>..<HASH> 100644 --- a/core/IP.php +++ b/core/IP.php @@ -83,6 +83,9 @@ class IP // examine proxy headers foreach ($proxyHeaders as $proxyHeader) { if (!empty($_SERVER[$proxyHeader])) { + // this may be buggy if someone has proxy IPs and proxy host headers configured as + // `$_SERVER[$proxyHeader]` could be eg $_SERVER['HTTP_X_FORWARDED_HOST'] and + // include an actual host name, not an IP $proxyIp = self::getLastIpFromList($_SERVER[$proxyHeader], $proxyIps); if (strlen($proxyIp) && stripos($proxyIp, 'unknown') === false) { return $proxyIp;
refs #<I> added a comment that this code may be buggy
diff --git a/tests/utils.py b/tests/utils.py index <HASH>..<HASH> 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -14,6 +14,9 @@ # Yoda. If not, see <http://www.gnu.org/licenses/gpl-3.0.html>. import mock +import os +import shutil + from mock import Mock from mock import MagicMock from yoda import Config @@ -26,3 +29,28 @@ def mock_config(data): config.get = MagicMock(return_value=data) config.write = MagicMock(return_value=None) return config + + +class Sandbox: + """ Sandbox environment utility """ + path = None + + def __init__(self, path=None): + """ Init sandbox environment """ + if path is None: + path = os.path.dirname(os.path.realpath(__file__)) + "/sandbox" + + self.path = path + if os.path.exists(path): + self.destroy() + + os.mkdir(path) + + def mkdir(self, directory): + """ Create directory in sandbox. """ + os.mkdir(os.path.join(self.path, directory)) + + def destroy(self): + """ Destroy sandbox environment """ + if os.path.exists(self.path): + shutil.rmtree(self.path)
Added Sandbox utility for tests.
diff --git a/girder/api/v1/system.py b/girder/api/v1/system.py index <HASH>..<HASH> 100644 --- a/girder/api/v1/system.py +++ b/girder/api/v1/system.py @@ -411,7 +411,8 @@ class System(Resource): models = ['folder', 'item'] steps = sum(self.model(model).find().count() for model in models) progress.update( - total=steps, current=0, title='Checking for incorrect base parents') + total=steps, current=0, + title='Checking for incorrect base parents (Step 2 of 3)') for model in models: for doc in self.model(model).find(): progress.update(increment=1) @@ -434,7 +435,8 @@ class System(Resource): models = ['folder', 'item', 'file'] steps = sum(self.model(model).find().count() for model in models) progress.update( - total=steps, current=0, title='Checking for orphaned records') + total=steps, current=0, + title='Checking for orphaned records (Step 1 of 3)') for model in models: for doc in self.model(model).find(): progress.update(increment=1) @@ -449,7 +451,8 @@ class System(Resource): models = ['collection', 'user'] steps = sum(self.model(model).find().count() for model in models) progress.update( - total=steps, current=0, title='Checking for incorrect sizes') + total=steps, current=0, + title='Checking for incorrect sizes (Step 3 of 3)') for model in models: for doc in self.model(model).find(): progress.update(increment=1)
Include Step N of 3 in progress message
diff --git a/lib/carapace.js b/lib/carapace.js index <HASH>..<HASH> 100644 --- a/lib/carapace.js +++ b/lib/carapace.js @@ -14,6 +14,9 @@ var events = require('eventemitter2'), evref = require('../build/default/evref'); module.exports = carapace = new events.EventEmitter2(); +for (var k in carapace) { + carapace[k] = carapace[k]; +} // // Plugins list @@ -126,4 +129,4 @@ carapace.run = function (argv, callback) { } return carapace; -}; \ No newline at end of file +};
[fix] reset the prototype methods to be directly on carapace so dnode picks them up
diff --git a/src/main/php/response/Headers.php b/src/main/php/response/Headers.php index <HASH>..<HASH> 100644 --- a/src/main/php/response/Headers.php +++ b/src/main/php/response/Headers.php @@ -87,6 +87,8 @@ class Headers implements \IteratorAggregate /** * checks if header with given name is present * + * Please note that header names are treated case sensitive. + * * @param string $name * @return bool */
add note about case sensitivity of header names
diff --git a/p2p/protocol/internal/circuitv1-deprecated/relay.go b/p2p/protocol/internal/circuitv1-deprecated/relay.go index <HASH>..<HASH> 100644 --- a/p2p/protocol/internal/circuitv1-deprecated/relay.go +++ b/p2p/protocol/internal/circuitv1-deprecated/relay.go @@ -107,12 +107,12 @@ func (r *Relay) rmLiveHop(from, to peer.ID) { r.lhLk.Lock() defer r.lhLk.Unlock() - r.lhCount-- trg, ok := r.liveHops[from] if !ok { return } + r.lhCount-- delete(trg, to) if len(trg) == 0 { delete(r.liveHops, from)
Only decrement hop counter when actually removing live hop
diff --git a/lib/gir_ffi/builder/type/object.rb b/lib/gir_ffi/builder/type/object.rb index <HASH>..<HASH> 100644 --- a/lib/gir_ffi/builder/type/object.rb +++ b/lib/gir_ffi/builder/type/object.rb @@ -83,6 +83,7 @@ module GirFFI @klass.class_eval builder.setter_def end + # TODO: Guard agains accidental invocation of undefined vfuncs. def setup_vfunc_invokers info.vfuncs.each do |vfinfo| invoker = vfinfo.invoker diff --git a/test/integration/generated_gimarshallingtests_test.rb b/test/integration/generated_gimarshallingtests_test.rb index <HASH>..<HASH> 100644 --- a/test/integration/generated_gimarshallingtests_test.rb +++ b/test/integration/generated_gimarshallingtests_test.rb @@ -273,7 +273,6 @@ describe GIMarshallingTests do # NOTE: To call this method, the callback slot vfunc_with_callback has to # be filled in the GIMarshallingTests::Object class structure. The # GIMarshallingTests library doesn't do this. - # FIXME: Guard agains accidental invocation of undefined vfuncs. skip "Needs vfunc setup" end
Move a FIXME to a TODO in the right location
diff --git a/application/setup.py b/application/setup.py index <HASH>..<HASH> 100644 --- a/application/setup.py +++ b/application/setup.py @@ -42,6 +42,7 @@ setup( 'python-gnupg', 'repoze.xmliter', 'Paste', + 'watchdog', ], extras_require={ 'development': [
we (apparently) now require the watchdog module
diff --git a/packages/core/renderers/bolt-base.js b/packages/core/renderers/bolt-base.js index <HASH>..<HASH> 100644 --- a/packages/core/renderers/bolt-base.js +++ b/packages/core/renderers/bolt-base.js @@ -15,14 +15,6 @@ export function BoltBase(Base = HTMLElement) { if (!this.slots) { this.setupSlots(); } - - // Automatically force a component to render if no props exist BUT props are defined. - if ( - Object.keys(this.props).length !== 0 && - Object.keys(this._props).length === 0 - ) { - this.updated(); - } } setupSlots() {
refactor: remove auto `updated()` call in component's connected callback — fixes issue with components using context not always having data available initially
diff --git a/lib/gitlog-md/version.rb b/lib/gitlog-md/version.rb index <HASH>..<HASH> 100644 --- a/lib/gitlog-md/version.rb +++ b/lib/gitlog-md/version.rb @@ -1,5 +1,5 @@ module GitlogMD module Version - STRING = '0.0.2' + STRING = '0.0.3' end end
(GEM) update gitlog-md version to <I>
diff --git a/tests/test_debuglink.py b/tests/test_debuglink.py index <HASH>..<HASH> 100644 --- a/tests/test_debuglink.py +++ b/tests/test_debuglink.py @@ -9,9 +9,12 @@ from trezorlib.client import PinException class TestDebugLink(common.TrezorTest): + # disable for now + """ def test_layout(self): layout = self.client.debug.read_layout() self.assertEqual(len(layout), 1024) + """ def test_mnemonic(self): self.setup_mnemonic_nopin_nopassphrase()
disable layout retrieval in debuglink for now
diff --git a/vsphere/virtual_machine_config_structure.go b/vsphere/virtual_machine_config_structure.go index <HASH>..<HASH> 100644 --- a/vsphere/virtual_machine_config_structure.go +++ b/vsphere/virtual_machine_config_structure.go @@ -540,6 +540,11 @@ func flattenExtraConfig(d *schema.ResourceData, opts []types.BaseOptionValue) er func expandVAppConfig(d *schema.ResourceData, client *govmomi.Client) *types.VmConfigSpec { if !d.HasChange("vapp") { return nil + } else { + // Many vApp config values, such as IP address, will require a + // restart of the machine to properly apply. We don't necessarily + // know which ones they are, so we will restart for every change. + d.Set("reboot_required", true) } var props []types.VAppPropertySpec
Reboot required for change in vApp config
diff --git a/kubernetes/check.py b/kubernetes/check.py index <HASH>..<HASH> 100644 --- a/kubernetes/check.py +++ b/kubernetes/check.py @@ -372,7 +372,6 @@ class Kubernetes(AgentCheck): self.publish_gauge(self, '{}.{}.limits'.format(NAMESPACE, limit), values[0], _tags) except (KeyError, AttributeError) as e: self.log.debug("Unable to retrieve container limits for %s: %s", c_name, e) - self.log.debug("Container object for {}: {}".format(c_name, container)) # requests try: @@ -384,7 +383,6 @@ class Kubernetes(AgentCheck): self.publish_gauge(self, '{}.{}.requests'.format(NAMESPACE, request), values[0], _tags) except (KeyError, AttributeError) as e: self.log.debug("Unable to retrieve container requests for %s: %s", c_name, e) - self.log.debug("Container object for {}: {}".format(c_name, container)) self._update_pods_metrics(instance, pods_list) self._update_node(instance)
[kubernetes] Remove debug log lines (#<I>) Those logs line can leak sensitive data. We should not log them.
diff --git a/lib/sshkit/backends/abstract.rb b/lib/sshkit/backends/abstract.rb index <HASH>..<HASH> 100644 --- a/lib/sshkit/backends/abstract.rb +++ b/lib/sshkit/backends/abstract.rb @@ -127,6 +127,12 @@ module SSHKit end end + # Backends which extend the Abstract backend should implement the following methods: + def upload!(local, remote, options = {}) raise MethodUnavailableError end + def download!(remote, local=nil, options = {}) raise MethodUnavailableError end + def execute_command(cmd) raise MethodUnavailableError end + private :execute_command # Can inline after Ruby 2.1 + private def output diff --git a/test/unit/backends/test_abstract.rb b/test/unit/backends/test_abstract.rb index <HASH>..<HASH> 100644 --- a/test/unit/backends/test_abstract.rb +++ b/test/unit/backends/test_abstract.rb @@ -64,6 +64,16 @@ module SSHKit assert_equal 'Some stdout', output end + def test_calling_abstract_with_undefined_execute_command_raises_exception + abstract = Abstract.new(ExampleBackend.example_host) do + execute(:some_command) + end + + assert_raises(SSHKit::Backend::MethodUnavailableError) do + abstract.run + end + end + def test_abstract_backend_can_be_configured Abstract.configure do |config| config.some_option = 100
Added stub implementations for abstract methods on Abstract backend Stub methods throw MethodUnavailableError to be consistent with previous behaviour
diff --git a/lib/ffmpeg/movie.rb b/lib/ffmpeg/movie.rb index <HASH>..<HASH> 100644 --- a/lib/ffmpeg/movie.rb +++ b/lib/ffmpeg/movie.rb @@ -114,7 +114,7 @@ module FFMPEG end def calculated_aspect_ratio - aspect_from_dar || aspect_from_dimensions + aspect_from_dimensions end def calculated_pixel_aspect_ratio
Ignore DAR when calculating dimensions
diff --git a/lib/beaker-pe/install/pe_utils.rb b/lib/beaker-pe/install/pe_utils.rb index <HASH>..<HASH> 100644 --- a/lib/beaker-pe/install/pe_utils.rb +++ b/lib/beaker-pe/install/pe_utils.rb @@ -111,8 +111,8 @@ module Beaker pe_debug = host[:pe_debug] || opts[:pe_debug] ? ' -D' : '' pe_cmd = "cd #{host['working_dir']}/#{host['dist']} && ./#{host['pe_installer']}#{pe_debug}" if ! version_is_less(host['pe_ver'], '2016.2.1') - # -f option forces non-interactive mode - pe_cmd += " -f" + # -y option sets "assume yes" mode where yes or whatever default will be assumed + pe_cmd += " -y" end # If there are no answer overrides, and we are doing an upgrade from 2016.2.0,
(PE-<I>) Change -f option to -y Prior to this commit I was using the `-f` option in the installer, now it is `-y`. For more information, see <URL>
diff --git a/tests/resources/conf.py b/tests/resources/conf.py index <HASH>..<HASH> 100644 --- a/tests/resources/conf.py +++ b/tests/resources/conf.py @@ -28,13 +28,17 @@ use os.path.abspath to make it absolute, like shown here. import sys +import os + +sys.path.insert(0, os.path.abspath('..')) + import semantic_version from recommonmark.parser import CommonMarkParser -_package = '{{ package }}' +_package = 'steenzout.sphinx' _version = semantic_version.Version('{{ metadata.__version__ }}') # -- General configuration ------------------------------------------------
updated conf.py expected output.
diff --git a/ELiDE/layout.py b/ELiDE/layout.py index <HASH>..<HASH> 100644 --- a/ELiDE/layout.py +++ b/ELiDE/layout.py @@ -60,14 +60,14 @@ class ELiDELayout(FloatLayout): d = arr.destination.name self.board.remove_widget(arr) del self.board.arrow[o][d] - del self.board.character.portal[o][d] + arr.portal.delete() elif isinstance(self.selection, Spot): spot = self.selection spot.canvas.clear() self.selection = None self.board.remove_widget(spot) del self.board.spot[spot.name] - del self.board.character.place[spot.name] + spot.remote.delete() else: assert(isinstance(self.selection, Pawn)) pawn = self.selection @@ -80,8 +80,8 @@ class ELiDELayout(FloatLayout): canvas.remove(pawn.group) self.selection = None self.board.remove_widget(pawn) - del self.board.pawn[pawn.name] del self.board.character.thing[pawn.name] + pawn.remote.delete() def toggle_spot_config(self): """Show the dialog where you select graphics and a name for a place,
let LiSE decide how best to delete an entity
diff --git a/addon/mixins/in-viewport.js b/addon/mixins/in-viewport.js index <HASH>..<HASH> 100644 --- a/addon/mixins/in-viewport.js +++ b/addon/mixins/in-viewport.js @@ -107,7 +107,7 @@ export default Mixin.create({ this.intersectionObserver = new IntersectionObserver(bind(this, this._onIntersection), options); this.intersectionObserver.observe(element); } else { - const height = scrollableArea ? scrollableArea.offsetHeight : window.innerHeight; + const height = scrollableArea ? scrollableArea.offsetHeight + scrollableArea.getBoundingClientRect().top: window.innerHeight; const width = scrollableArea ? scrollableArea.offsetWidth : window.innerWidth; const boundingClientRect = element.getBoundingClientRect();
update rafLogic for scrollable area (#<I>)
diff --git a/lib/mongo/monitoring/command_log_subscriber.rb b/lib/mongo/monitoring/command_log_subscriber.rb index <HASH>..<HASH> 100644 --- a/lib/mongo/monitoring/command_log_subscriber.rb +++ b/lib/mongo/monitoring/command_log_subscriber.rb @@ -53,7 +53,9 @@ module Mongo # # @since 2.1.0 def started(event) - log_debug("#{prefix(event)} | STARTED | #{format_command(event.command)}") + if logger.debug? + log_debug("#{prefix(event)} | STARTED | #{format_command(event.command)}") + end end # Handle the command succeeded event. @@ -65,7 +67,9 @@ module Mongo # # @since 2.1.0 def succeeded(event) - log_debug("#{prefix(event)} | SUCCEEDED | #{event.duration}s") + if logger.debug? + log_debug("#{prefix(event)} | SUCCEEDED | #{event.duration}s") + end end # Handle the command failed event. @@ -77,7 +81,9 @@ module Mongo # # @since 2.1.0 def failed(event) - log_debug("#{prefix(event)} | FAILED | #{event.message} | #{event.duration}s") + if logger.debug? + log_debug("#{prefix(event)} | FAILED | #{event.message} | #{event.duration}s") + end end private
RUBY-<I>: Improve performance on log subscriber
diff --git a/lib/stack_tracy/sinatra.rb b/lib/stack_tracy/sinatra.rb index <HASH>..<HASH> 100644 --- a/lib/stack_tracy/sinatra.rb +++ b/lib/stack_tracy/sinatra.rb @@ -10,10 +10,9 @@ module StackTracy def call(env) request = ::Sinatra::Request.new env - if request.path.match /^\/tracy-?(.*)?/ - return open($1) + if request.path.match /^\/tracy(-.*)?/ + return open($1.to_s.gsub(/^-/, "")) end - if @before_filter.nil? || !!@before_filter.call(request.path, request.params) result = nil stack_tracy @arg || Dir::tmpdir, @options do @@ -28,7 +27,17 @@ module StackTracy private def open(match) - StackTracy.open match.to_s.empty? ? nil : match, (match.to_s.empty? && @arg.to_s != "dump" && !StackTracy.stack_trace.empty?) + if match.empty? + if StackTracy.stack_trace.empty? + StackTracy.open + else + StackTracy.dump do |file| + StackTracy.open file, true + end + end + else + StackTracy.open match + end [200, {"Content-Type" => "text/html;charset=utf-8", "Content-Length" => Rack::Utils.bytesize("").to_s}, ""] end
Improved StackTracy::Sinatra middleware a bit regarding the `/tracy` route
diff --git a/ui/src/components/layout/QDrawer.js b/ui/src/components/layout/QDrawer.js index <HASH>..<HASH> 100644 --- a/ui/src/components/layout/QDrawer.js +++ b/ui/src/components/layout/QDrawer.js @@ -88,7 +88,7 @@ export default Vue.extend({ belowBreakpoint, showing: this.showIfAbove === true && belowBreakpoint === false ? true - : this.value + : this.value === true } }, @@ -537,12 +537,8 @@ export default Vue.extend({ this.$emit('mini-state', this.isMini) const fn = () => { - if (this.showing === true) { - this.__show(false, true) - } - else { - this.__hide(false, true) - } + const action = this.showing === true ? 'show' : 'hide' + this[`__${action}`](false, true) } if (this.layout.width !== 0) {
fix(QDrawer): backdrop not initialized correctly due to faulty "showing" value #<I>
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -81,9 +81,12 @@ module.exports = klass.extend({ } } }, + promise : function(fn){ + return promise.create(fn) + }, load : function(){ var req = this - return promise.create(function(resolve, reject){ + return req.promise(function(resolve, reject){ var xhr = new XMLHttpRequest() var callback = createCallback(resolve, reject) var url = resolveURL(req.url, req.queryString) @@ -112,5 +115,6 @@ module.exports = klass.extend({ post : createShorthand("POST"), del : createShorthand("DELETE"), put : createShorthand("PUT"), - patch : createShorthand("PATCH") + options : createShorthand("OPTIONS"), + head : createShorthand("HEAD") })
custom promises & http methods shorthands
diff --git a/packages/react-atlas-core/src/checkbox/Checkbox.js b/packages/react-atlas-core/src/checkbox/Checkbox.js index <HASH>..<HASH> 100644 --- a/packages/react-atlas-core/src/checkbox/Checkbox.js +++ b/packages/react-atlas-core/src/checkbox/Checkbox.js @@ -23,7 +23,10 @@ class Checkbox extends React.PureComponent { /* Check if onClick has been passed, if so call it. */ if (this.props.onClick) { - this.props.onClick(event); + /* Pass the event object, and a data object to the click handler. + The data object contains a boolean for whether the checkbox was + clicked or not, plus all the props passed to the object. */ + this.props.onClick(event, {"checked": this.state.checked, "props": this.state.checked}); } };
Pass event and data object to onClick handler.
diff --git a/MySQLdb/connections.py b/MySQLdb/connections.py index <HASH>..<HASH> 100644 --- a/MySQLdb/connections.py +++ b/MySQLdb/connections.py @@ -140,7 +140,9 @@ class Connection(_mysql.connection): integer, non-zero enables LOAD LOCAL INFILE; zero disables autocommit + If False (default), autocommit is disabled. If True, autocommit is enabled. + If None, autocommit isn't set and server default is used. There are a number of undocumented, non-standard methods. See the documentation for the MySQL C API for some hints on what they do. @@ -227,9 +229,11 @@ class Connection(_mysql.connection): self.encoders[types.StringType] = string_literal self.encoders[types.UnicodeType] = unicode_literal self._transactional = self.server_capabilities & CLIENT.TRANSACTIONS - if self._transactional and not kwargs2.pop('autocommit', False): + if self._transactional: # PEP-249 requires autocommit to be initially off - self.autocommit(False) + autocommit = kwargs2.pop('autocommit', False) + if autocommit is not None: + self.autocommit(bool(True)) self.messages = [] def cursor(self, cursorclass=None):
autocommit=None means using server default.
diff --git a/lib/dataset.js b/lib/dataset.js index <HASH>..<HASH> 100644 --- a/lib/dataset.js +++ b/lib/dataset.js @@ -695,10 +695,8 @@ TextS3File.prototype.iterate = function (task, p, pipeline, done) { task.log('stream s3', this.bucket, this.path); if (this.options.parquet || this.path.slice(-8) === '.parquet') return parquetStream(rs, this.path, task, pipeline, done); - if (this.path.slice(-3) === '.gz') rs = rs.pipe(task.lib.zlib.createGunzip({chunkSize: 65536})); - iterateStream(rs, task, pipeline, done); }; @@ -948,7 +946,8 @@ TextLocal.prototype.iterate = function (task, p, pipeline, done) { return parquetIterate(path, pipeline, done); var rs = task.lib.fs.createReadStream(path); if (path.slice(-3) === '.gz') - rs.pipe(task.lib.zlib.createGunzip({chunkSize: 65536})); + rs = rs.pipe(task.lib.zlib.createGunzip({chunkSize: 65536})); + iterateStream(rs, task, pipeline, done); };
textFile: Fix handling of gzipped files in local filesystem The returned stream was operating on the compressed data instead ofs uncompressed.
diff --git a/modules/piperename.py b/modules/piperename.py index <HASH>..<HASH> 100644 --- a/modules/piperename.py +++ b/modules/piperename.py @@ -27,8 +27,11 @@ def pipe_rename(context, _INPUT, conf, **kwargs): for item in _INPUT: for rule in rules: - item[rule[2]] = item[rule[1]] + #Map names with dot notation onto nested dictionaries, e.g. 'a.content' -> ['a']['content'] + #todo: optimise by pre-calculating splits + # and if this logic is stable, wrap in util functions and use everywhere items are accessed + reduce(lambda i,k:i.get(k), [item] + rule[2].split('.')[:-1])[rule[2].split('.')[-1]] = reduce(lambda i,k:i.get(k), [item] + rule[1].split('.')) if rule[0] == 'rename': - del item[rule[1]] + del reduce(lambda i,k:i.get(k), [item] + rule[1].split('.')[:-1])[rule[1].split('.')[-1]] yield item
Allow dot notation to map to nested dictionaries
diff --git a/heater.go b/heater.go index <HASH>..<HASH> 100644 --- a/heater.go +++ b/heater.go @@ -162,6 +162,9 @@ func (h *Heater) getTarget(val *Value) { } func (h *Heater) readTemperature(msg *Message) { + if msg.Name != "temperature" { + return + } temp, ok := msg.Value.ToFloat() if ok { h.currentTemp = temp
fixed heater bug it was reading any update to use as its temperature
diff --git a/lib/mongoid/components.rb b/lib/mongoid/components.rb index <HASH>..<HASH> 100644 --- a/lib/mongoid/components.rb +++ b/lib/mongoid/components.rb @@ -84,7 +84,7 @@ module Mongoid #:nodoc def prohibited_methods @prohibited_methods ||= MODULES.inject([]) do |methods, mod| methods.tap do |mets| - mets << mod.instance_methods + mets << mod.instance_methods.map{ |m| m.to_sym } end end.flatten end diff --git a/spec/unit/mongoid/components_spec.rb b/spec/unit/mongoid/components_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/mongoid/components_spec.rb +++ b/spec/unit/mongoid/components_spec.rb @@ -15,7 +15,7 @@ describe Mongoid::Components do mod.instance_methods.each do |method| it "includes #{method}" do - methods.should include(method) + methods.should include(method.to_sym) end end end
Checking field collisions should work on <I>.x
diff --git a/test/src/test/java/hudson/tasks/ArtifactArchiverTest.java b/test/src/test/java/hudson/tasks/ArtifactArchiverTest.java index <HASH>..<HASH> 100644 --- a/test/src/test/java/hudson/tasks/ArtifactArchiverTest.java +++ b/test/src/test/java/hudson/tasks/ArtifactArchiverTest.java @@ -37,6 +37,7 @@ import hudson.tasks.LogRotatorTest.TestsFail; import static hudson.tasks.LogRotatorTest.build; import java.io.File; import java.io.IOException; +import java.net.HttpURLConnection; import java.nio.charset.Charset; import java.util.Arrays; import java.util.Collections; @@ -230,6 +231,7 @@ public class ArtifactArchiverTest { assertFalse(kids[0].isDirectory()); assertFalse(kids[0].isFile()); assertFalse(kids[0].exists()); + j.createWebClient().assertFails(b.getUrl() + "artifact/hack", HttpURLConnection.HTTP_NOT_FOUND); } private void runNewBuildAndStartUnitlIsCreated(AbstractProject project) throws InterruptedException{
Also checking DirectoryBrowserSupport behavior, as in DirectoryBrowserSupportTest.
diff --git a/src/access.js b/src/access.js index <HASH>..<HASH> 100644 --- a/src/access.js +++ b/src/access.js @@ -89,18 +89,28 @@ } }; + Object.defineProperty(RemoteStorage.prototype, 'access', { + get: function() { + var access = new RemoteStorage.Access(); + Object.defineProperty(RemoteStorage.prototype, 'access', { + value: access + }); + return access; + }, + configurable: true + }); + RemoteStorage.prototype.claimAccess = function(scopes) { + if(typeof(scopes) === 'object') { + for(var key in scopes) { + this.access.claim(key, scopes[key]); + } + } else { + this.access.claim(arguments[0], arguments[1]); + } + }; + RemoteStorage.Access._rs_init = function() { haveLocalStorage = 'localStorage' in global; - Object.defineProperty(RemoteStorage.prototype, 'access', { - get: function() { - var access = new RemoteStorage.Access(); - Object.defineProperty(RemoteStorage.prototype, 'access', { - value: access - }); - return access; - }, - configurable: true - }); return promising().fulfill(); };
have remoteStorage.claimAccess and remoteStorage.access always defined
diff --git a/spec/generators/rails/mobility/install_generator_spec.rb b/spec/generators/rails/mobility/install_generator_spec.rb index <HASH>..<HASH> 100644 --- a/spec/generators/rails/mobility/install_generator_spec.rb +++ b/spec/generators/rails/mobility/install_generator_spec.rb @@ -1,8 +1,6 @@ require "spec_helper" describe Mobility::InstallGenerator, type: :generator, orm: :active_record do - break unless Mobility::Loaded::Rails - require "generator_spec/test_case" include GeneratorSpec::TestCase
Remove unnecessary break in install generator spec
diff --git a/example/keyboard/main.go b/example/keyboard/main.go index <HASH>..<HASH> 100644 --- a/example/keyboard/main.go +++ b/example/keyboard/main.go @@ -30,13 +30,14 @@ const ( // TODO: Add Key.String() by stringer var keyNames = map[ebiten.Key]string{ - ebiten.KeyComma: "','", - ebiten.KeyDelete: "Delete", - ebiten.KeyEnter: "Enter", - ebiten.KeyEscape: "Escape", - ebiten.KeyPeriod: "'.'", - ebiten.KeySpace: "Space", - ebiten.KeyTab: "Tab", + ebiten.KeyBackspace: "Backspace", + ebiten.KeyComma: "','", + ebiten.KeyDelete: "Delete", + ebiten.KeyEnter: "Enter", + ebiten.KeyEscape: "Escape", + ebiten.KeyPeriod: "'.'", + ebiten.KeySpace: "Space", + ebiten.KeyTab: "Tab", // Arrows ebiten.KeyDown: "Down",
Bug fix: Add 'backspace' to example/keyboard
diff --git a/core/block_validator.go b/core/block_validator.go index <HASH>..<HASH> 100644 --- a/core/block_validator.go +++ b/core/block_validator.go @@ -89,7 +89,7 @@ func (v *BlockValidator) ValidateState(block *types.Block, statedb *state.StateD if rbloom != header.Bloom { return fmt.Errorf("invalid bloom (remote: %x local: %x)", header.Bloom, rbloom) } - // Tre receipt Trie's root (R = (Tr [[H1, R1], ... [Hn, R1]])) + // Tre receipt Trie's root (R = (Tr [[H1, R1], ... [Hn, Rn]])) receiptSha := types.DeriveSha(receipts, new(trie.Trie)) if receiptSha != header.ReceiptHash { return fmt.Errorf("invalid receipt root hash (remote: %x local: %x)", header.ReceiptHash, receiptSha)
core: fix a typo in comment (#<I>)
diff --git a/openstack_dashboard/utils/settings.py b/openstack_dashboard/utils/settings.py index <HASH>..<HASH> 100644 --- a/openstack_dashboard/utils/settings.py +++ b/openstack_dashboard/utils/settings.py @@ -117,7 +117,7 @@ def update_dashboards(modules, horizon_config, installed_apps): horizon_config['panel_customization'] = panel_customization horizon_config['dashboards'] = tuple(dashboards) - horizon_config['exceptions'].update(exceptions) + horizon_config.setdefault('exceptions', {}).update(exceptions) horizon_config.update(update_horizon_config) horizon_config.setdefault('angular_modules', []).extend(angular_modules) horizon_config.setdefault('js_files', []).extend(js_files)
Permit 'exceptions' to be omitted from HORIZON_CONFIG Without this change, if HORIZON_CONFIG is defined in local_settings.py and does not have an 'exceptions' entry, then horizon throws and exception and fails to start. Change-Id: I<I>f<I>d1c<I>ac<I>bdcc<I>d5acb2a0b<I> Closes-Bug: #<I>
diff --git a/hypermap/aggregator/models.py b/hypermap/aggregator/models.py index <HASH>..<HASH> 100644 --- a/hypermap/aggregator/models.py +++ b/hypermap/aggregator/models.py @@ -244,7 +244,7 @@ class Layer(Resource): elif self.service.type == 'WM': # we use the geoserver virtual layer getcapabilities for this purpose url = 'http://worldmap.harvard.edu/geoserver/geonode/%s/wms?' % self.name - ows = WebMapService(url) + ows = WebMapService(url, username=settings.WM_USERNAME, password=settings.WM_USERNAME_PASSWORD) op_getmap = ows.getOperationByName('GetMap') image_format = 'image/png' if image_format not in op_getmap.formatOptions: diff --git a/hypermap/settings/default.py b/hypermap/settings/default.py index <HASH>..<HASH> 100644 --- a/hypermap/settings/default.py +++ b/hypermap/settings/default.py @@ -176,3 +176,13 @@ SKIP_CELERY_TASK = False # taggit TAGGIT_CASE_INSENSITIVE = True + +# WorldMap Service credentials (override this in local_settings or _ubuntu in production) +WM_USERNAME = 'wmuser' +WM_USERNAME_PASSWORD = 'secret' + +# Load more settings from a file called local_settings.py if it exists +try: + from local_settings import * # noqa +except ImportError: + pass
Now doing getmap with username and password in WM layer, this way we get valid checks and thumbnails for private layers
diff --git a/QUANTAXIS/QAARP/QARisk.py b/QUANTAXIS/QAARP/QARisk.py index <HASH>..<HASH> 100755 --- a/QUANTAXIS/QAARP/QARisk.py +++ b/QUANTAXIS/QAARP/QARisk.py @@ -48,13 +48,15 @@ class QA_Risk(): self.fetch = {MARKET_TYPE.STOCK_CN: QA_fetch_stock_day_adv, MARKET_TYPE.INDEX_CN: QA_fetch_index_day_adv} - @lru_cache() + @property + @lru_cache() def market_data(self): return QA_fetch_stock_day_adv(self.account.code, self.account.start_date, self.account.end_date) - @lru_cache() + @property + @lru_cache() def assets(self): '惰性计算 日市值' return ((self.market_data.to_qfq().pivot('close') * self.account.daily_hold).sum(axis=1) + self.account.daily_cash.set_index('date').cash).fillna(method='pad')
#fix bug for @lru_cache()
diff --git a/src/Aspect/ContractCheckerAspect.php b/src/Aspect/ContractCheckerAspect.php index <HASH>..<HASH> 100644 --- a/src/Aspect/ContractCheckerAspect.php +++ b/src/Aspect/ContractCheckerAspect.php @@ -34,7 +34,6 @@ class ContractCheckerAspect implements Aspect /** * Default constructor * - * @todo Remove injection of reader * @param Reader $reader Annotation reader */ public function __construct(Reader $reader) @@ -122,7 +121,6 @@ class ContractCheckerAspect implements Aspect $result = $invocation->proceed(); $args['__result'] = $result; - // TODO: Do not use reader directly and pack annotation information into reflection foreach ($this->reader->getClassAnnotations($class) as $annotation) { if (!$annotation instanceof Contract\Invariant) { continue;
Clean todos from the source code
diff --git a/server/webapp/WEB-INF/rails/spec/webpack/views/agents/agents_widget_spec.js b/server/webapp/WEB-INF/rails/spec/webpack/views/agents/agents_widget_spec.js index <HASH>..<HASH> 100644 --- a/server/webapp/WEB-INF/rails/spec/webpack/views/agents/agents_widget_spec.js +++ b/server/webapp/WEB-INF/rails/spec/webpack/views/agents/agents_widget_spec.js @@ -238,6 +238,8 @@ describe("Agents Widget", () => { }); it('should show message after deleting the agents', () => { + route(true); + jasmine.Ajax.withMock(() => { clickAllAgents(); allowBulkUpdate('DELETE');
Attempt to fix flaky Agents Spec
diff --git a/lib/simple_form/components/hints.rb b/lib/simple_form/components/hints.rb index <HASH>..<HASH> 100644 --- a/lib/simple_form/components/hints.rb +++ b/lib/simple_form/components/hints.rb @@ -3,12 +3,16 @@ module SimpleForm # Needs to be enabled in order to do automatic lookups. module Hints def hint - if options[:hint] == true + @hint ||= if options[:hint] == true translate(:hints) else options[:hint] end end + + def has_hint? + hint.present? + end end end end diff --git a/lib/simple_form/wrappers/root.rb b/lib/simple_form/wrappers/root.rb index <HASH>..<HASH> 100644 --- a/lib/simple_form/wrappers/root.rb +++ b/lib/simple_form/wrappers/root.rb @@ -26,7 +26,7 @@ module SimpleForm css = options[:wrapper_class] ? Array.wrap(options[:wrapper_class]) : @defaults[:class] css += input.html_classes css << (options[:wrapper_error_class] || @defaults[:error_class]) if input.has_errors? - css << (options[:wrapper_hint_class] || @defaults[:hint_class]) if input.hint + css << (options[:wrapper_hint_class] || @defaults[:hint_class]) if input.has_hint? css end end
Use similar api for hints and errors, and cache hint to avoid double lookup
diff --git a/lib/s3repo/base.rb b/lib/s3repo/base.rb index <HASH>..<HASH> 100644 --- a/lib/s3repo/base.rb +++ b/lib/s3repo/base.rb @@ -10,7 +10,7 @@ module S3Repo def bucket @bucket ||= @options[:bucket] || ENV['S3_BUCKET'] - fail('No bucket given') unless bucket + fail('No bucket given') unless @bucket end def client
such loop, very recurse
diff --git a/openquake/hazardlib/gsim/base.py b/openquake/hazardlib/gsim/base.py index <HASH>..<HASH> 100644 --- a/openquake/hazardlib/gsim/base.py +++ b/openquake/hazardlib/gsim/base.py @@ -250,7 +250,8 @@ class ContextMaker(object): :param truncnorm: an instance of scipy.stats.truncnorm :param epsilons: the epsilon bins :param monitor: a Monitor instance - :returns: an AccumDict + :returns: + an AccumDict with keys (poe, imt, rlzi) and mags, dists, lons, lats """ acc = AccumDict(accum=[]) ctx_mon = monitor('disagg_contexts', measuremem=False)
Improved docstring [skip CI]
diff --git a/cmd/torrent-metainfo-pprint/main.go b/cmd/torrent-metainfo-pprint/main.go index <HASH>..<HASH> 100644 --- a/cmd/torrent-metainfo-pprint/main.go +++ b/cmd/torrent-metainfo-pprint/main.go @@ -47,6 +47,9 @@ func processReader(r io.Reader) error { "AnnounceList": metainfo.AnnounceList, "UrlList": metainfo.UrlList, } + if len(metainfo.Nodes) > 0 { + d["Nodes"] = metainfo.Nodes + } if flags.Files { d["Files"] = info.UpvertedFiles() }
torrent-metainfo-pprint: include the 'nodes' field into the output when non-empty
diff --git a/zipline/utils/factory.py b/zipline/utils/factory.py index <HASH>..<HASH> 100644 --- a/zipline/utils/factory.py +++ b/zipline/utils/factory.py @@ -43,12 +43,6 @@ def data_path(): return data_path -def logger_path(): - import zipline - log_path = dirname(abspath(zipline.__file__)) - return os.join(log_path, 'logging.cfg') - - def load_market_data(): fp_bm = open(join(data_path(), "benchmark.msgpack"), "rb") bm_list = msgpack.loads(fp_bm.read())
Removes unused log_path method.
diff --git a/Minimal-J/src/main/java/org/minimalj/backend/db/AbstractTable.java b/Minimal-J/src/main/java/org/minimalj/backend/db/AbstractTable.java index <HASH>..<HASH> 100644 --- a/Minimal-J/src/main/java/org/minimalj/backend/db/AbstractTable.java +++ b/Minimal-J/src/main/java/org/minimalj/backend/db/AbstractTable.java @@ -367,7 +367,7 @@ public abstract class AbstractTable<T> { try (ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next() && result.size() < maxResults) { T object = readResultSetRow(resultSet, null); - if (this instanceof Table) { + if (this instanceof Table && !(this instanceof CodeTable)) { long id = IdUtils.getId(object); ((Table<T>) this).loadRelations(object, id); }
AbstractTable: no relations for Codes
diff --git a/src/main/java/edu/jhu/prim/vector/LongDoubleDenseVector.java b/src/main/java/edu/jhu/prim/vector/LongDoubleDenseVector.java index <HASH>..<HASH> 100644 --- a/src/main/java/edu/jhu/prim/vector/LongDoubleDenseVector.java +++ b/src/main/java/edu/jhu/prim/vector/LongDoubleDenseVector.java @@ -112,9 +112,7 @@ public class LongDoubleDenseVector implements LongDoubleVector { @Override public double dot(LongDoubleVector y) { - if (y instanceof LongDoubleSortedVector || y instanceof LongDoubleHashVector) { - return y.dot(this); - } else if (y instanceof LongDoubleDenseVector){ + if (y instanceof LongDoubleDenseVector){ LongDoubleDenseVector other = (LongDoubleDenseVector) y; int max = Math.min(idxAfterLast, other.idxAfterLast); double dot = 0; @@ -123,11 +121,7 @@ public class LongDoubleDenseVector implements LongDoubleVector { } return dot; } else { - double dot = 0; - for (int i=0; i<idxAfterLast; i++) { - dot += elements[i] * y.get(i); - } - return dot; + return y.dot(this); } }
Switching dense vectors to call their sparse vector's implementation of dot.
diff --git a/tests/digitalocean/models/compute/servers_tests.rb b/tests/digitalocean/models/compute/servers_tests.rb index <HASH>..<HASH> 100644 --- a/tests/digitalocean/models/compute/servers_tests.rb +++ b/tests/digitalocean/models/compute/servers_tests.rb @@ -8,6 +8,9 @@ Shindo.tests('Fog::Compute[:digitalocean] | servers collection', ['digitalocean' public_key_path = File.join(File.dirname(__FILE__), '../../fixtures/id_rsa.pub') private_key_path = File.join(File.dirname(__FILE__), '../../fixtures/id_rsa') + # Collection tests are consistently timing out on Travis wasting people's time and resources + pending if Fog.mocking? + collection_tests(service.servers, options, true) do @instance.wait_for { ready? } end
[DigitalOcean] Skip consistently timing out tests The server tests in digital ocean have been frequently timing out. * <URL>
diff --git a/pyzmp/node.py b/pyzmp/node.py index <HASH>..<HASH> 100644 --- a/pyzmp/node.py +++ b/pyzmp/node.py @@ -426,13 +426,15 @@ class Node(object): # Starting the clock start = time.time() - # signalling startup only the first time - self.started.set() - first_loop = True # loop listening to connection while not self.exit.is_set(): + # signalling startup only the first time, just after having check for exit request. + # We need to guarantee at least ONE call to update. + if first_loop: + self.started.set() + # blocking. messages are received ASAP. timeout only determine update/shutdown speed. socks = dict(poller.poll(timeout=100)) if svc_socket in socks and socks[svc_socket] == zmq.POLLIN: diff --git a/pyzmp/tests/test_node.py b/pyzmp/tests/test_node.py index <HASH>..<HASH> 100644 --- a/pyzmp/tests/test_node.py +++ b/pyzmp/tests/test_node.py @@ -140,6 +140,8 @@ def test_node_creation_args(): assert n1.is_alive() assert svc_url + # starting and shutdown should at least guarantee ONE call of update function. + exitcode = n1.shutdown() assert exitcode == 0 assert not n1.is_alive()
signaling node start after checking for exit request, to guarantee at least one call to update.
diff --git a/src/resources/views/corporation/starbase/status-tab.blade.php b/src/resources/views/corporation/starbase/status-tab.blade.php index <HASH>..<HASH> 100644 --- a/src/resources/views/corporation/starbase/status-tab.blade.php +++ b/src/resources/views/corporation/starbase/status-tab.blade.php @@ -230,10 +230,10 @@ }} @else {{ - round(($starbase->fuelBays->where('type_id', 16275)->first()->quantity / $starbase->baseStrontiumUsage)) + round(optional($starbase->fuelBays->where('type_id', 16275))->first()->quantity ?? 0 / $starbase->baseStrontiumUsage) }} hours at {{ - carbon('now')->addHours($starbase->fuelBays->where('type_id', 16275)->first()->quantity / $starbase->baseStrontiumUsage) + carbon('now')->addHours(optional($starbase->fuelBays->where('type_id', 16275))->first()->quantity ?? 0 / $starbase->baseStrontiumUsage) }} @endif @endif
Fix for offline POS (#<I>)
diff --git a/contribs/gmf/apps/desktop_alt/js/controller.js b/contribs/gmf/apps/desktop_alt/js/controller.js index <HASH>..<HASH> 100644 --- a/contribs/gmf/apps/desktop_alt/js/controller.js +++ b/contribs/gmf/apps/desktop_alt/js/controller.js @@ -99,6 +99,12 @@ app.AlternativeDesktopController = function($scope, $injector) { this.gridMergeTabs = { 'merged_osm_times': ['110', '126', '147'] }; + + // mark 'merged_osm_times' as translatable + /** @type {angularGettext.Catalog} */ + var gettextCatalog = $injector.get('gettextCatalog'); + gettextCatalog.getString('merged_osm_times'); + }; ol.inherits(app.AlternativeDesktopController, gmf.AbstractDesktopController);
Mark merged layer label as translatable
diff --git a/lib/cli.js b/lib/cli.js index <HASH>..<HASH> 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -80,7 +80,6 @@ module.exports = function (options) { var slap = new Slap(opts); Promise.all(opts._.map(function (path, i) { - slap.fileBrowser.refresh(path, _.noop); return slap.open(path.toString(), !i); })).done(); diff --git a/lib/ui/Slap.js b/lib/ui/Slap.js index <HASH>..<HASH> 100644 --- a/lib/ui/Slap.js +++ b/lib/ui/Slap.js @@ -11,6 +11,8 @@ var util = require('slap-util'); var BaseWidget = require('base-widget'); var Editor = require('editor-widget'); +var fs = require('fs'); + function Slap (opts) { var self = this; @@ -52,6 +54,10 @@ Slap.prototype.open = Promise.method(function (filePath, current) { var pane = self.paneForPath(filePath); pane = pane || new Pane({parent: self}); + if (fs.lstatSync(filePath).isDirectory()) { // check if filePath is a directory + self.fileBrowser.refresh(filePath, _.noop); // open the directory on the sidebar + return; + } return pane.editor.open(filePath) .then(function () { if (current) pane.setCurrent();
fix(slap): fix bug when given 'path/to/dir', slap opens the given directory instead of throwing an error EISDIR.
diff --git a/lib/makewcs.py b/lib/makewcs.py index <HASH>..<HASH> 100644 --- a/lib/makewcs.py +++ b/lib/makewcs.py @@ -80,7 +80,7 @@ PARITY = {'WFC':[[1.0,0.0],[0.0,-1.0]],'HRC':[[-1.0,0.0],[0.0,1.0]], NUM_PER_EXTN = {'ACS':3,'WFPC2':1,'STIS':3,'NICMOS':5, 'WFC3':3} -__version__ = '1.1.6 (19 May 2010)' +__version__ = '1.1.7 (6 Jul 2010)' def run(input,quiet=yes,restore=no,prepend='O', tddcorr=True): print "+ MAKEWCS Version %s" % __version__ @@ -265,7 +265,8 @@ def _update(image,idctab,nimsets,apply_tdd=False, elif instrument == 'WFC3': filter1 = readKeyword(hdr,'FILTER') filter2 = None - #filter2 = readKeyword(hdr,'FILTER2') + # use value of 'BINAXIS' keyword to set binning value for WFC3 data + binned = readKeyword(hdr,'BINAXIS1') else: filter1 = readKeyword(hdr,'FILTER1') filter2 = readKeyword(hdr,'FILTER2')
Updates to 'pydrizzle' and 'pytools' to correct the problem seen in processing binned WFC3 images, where the chips are over <I> pixels apart instead of just <I> (for binaxis=3). The SIP coefficients may still not be quite correct for binned data, though, but these fixes correctly mosaic binned WFC3/UVIS images. WJH git-svn-id: <URL>
diff --git a/lib/deliver/deliver_process.rb b/lib/deliver/deliver_process.rb index <HASH>..<HASH> 100644 --- a/lib/deliver/deliver_process.rb +++ b/lib/deliver/deliver_process.rb @@ -142,6 +142,11 @@ module Deliver def set_screenshots screens_path = @deploy_information[Deliverer::ValKey::SCREENSHOTS_PATH] + + if (ENV["DELIVER_SCREENSHOTS_PATH"] || '').length > 0 + Helper.log.warn "Overwriting screenshots path from config (#{screens_path}) with (#{ENV["DELIVER_SCREENSHOTS_PATH"]})".yellow + screens_path = ENV["DELIVER_SCREENSHOTS_PATH"] + end if screens_path if File.exists?('./Snapfile')
Added overwriting of screenshots path using environment for fastlane
diff --git a/src/Composer/Downloader/FileDownloader.php b/src/Composer/Downloader/FileDownloader.php index <HASH>..<HASH> 100644 --- a/src/Composer/Downloader/FileDownloader.php +++ b/src/Composer/Downloader/FileDownloader.php @@ -106,8 +106,8 @@ class FileDownloader implements DownloaderInterface $this->io->write(' Loading from cache'); } } catch (TransportException $e) { - if (404 === $e->getCode() && 'github.com' === $hostname) { - $message = "\n".'Could not fetch '.$processedUrl.', enter your GitHub credentials to access private repos'; + if (in_array($e->getCode(), array(404, 403)) && 'github.com' === $hostname && !$this->io->hasAuthentication($hostname)) { + $message = "\n".'Could not fetch '.$processedUrl.', enter your GitHub credentials '.($e->getCode === 404 ? 'to access private repos' : 'to go over the API rate limit'); $gitHubUtil = new GitHub($this->io, $this->config, null, $this->rfs); if (!$gitHubUtil->authorizeOAuth($hostname) && (!$this->io->isInteractive() || !$gitHubUtil->authorizeOAuthInteractively($hostname, $message))
Also try authenticating on github for <I> responses
diff --git a/test/util/compareDirectories.js b/test/util/compareDirectories.js index <HASH>..<HASH> 100644 --- a/test/util/compareDirectories.js +++ b/test/util/compareDirectories.js @@ -47,6 +47,9 @@ module.exports = function(dirA, dirB, cb) { filename = inBoth[i]; typeA = metadataA[filename].type; typeB = metadataB[filename].type; + // skip if both are directories + if('directory' === typeA && 'directory' === typeB) + continue; // something is wrong if one entry is a file and the other is a directory // (do a XOR with the ternary operator) if('directory' === typeA ? 'directory' !== typeB : 'directory' === typeB) {
fix tests (for real) sorry, only tested on win, but linux handles things differently
diff --git a/lib/Loader.php b/lib/Loader.php index <HASH>..<HASH> 100644 --- a/lib/Loader.php +++ b/lib/Loader.php @@ -107,7 +107,7 @@ abstract class Loader implements LoaderInterface } /** - * @param $input + * @param string $input * @return array|string */ protected function convertInputToSerializedJson($input) @@ -231,6 +231,8 @@ abstract class Loader implements LoaderInterface /** * @param string $payload + * @param string $input + * @param string $signature */ protected function createJWS($input, $protected_header, $unprotected_header, $payload, $signature) {
Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on <URL>
diff --git a/zsl/resource/model_resource.py b/zsl/resource/model_resource.py index <HASH>..<HASH> 100644 --- a/zsl/resource/model_resource.py +++ b/zsl/resource/model_resource.py @@ -94,6 +94,7 @@ class ResourceQueryContext(object): self._data = data # test if params is a list + # TODO: replace this with a better is_list test try: len(params) self._params = params
Add todo comment to questionable code
diff --git a/library/src/com/WazaBe/HoloEverywhere/widget/NumberPicker.java b/library/src/com/WazaBe/HoloEverywhere/widget/NumberPicker.java index <HASH>..<HASH> 100644 --- a/library/src/com/WazaBe/HoloEverywhere/widget/NumberPicker.java +++ b/library/src/com/WazaBe/HoloEverywhere/widget/NumberPicker.java @@ -414,7 +414,7 @@ public class NumberPicker extends LinearLayout { mInputText.selectAll(); } else { mInputText.setSelection(0, 0); - validateInputTextView(v); + validateInputTextView(mInputText); } } }); @@ -1359,8 +1359,8 @@ public class NumberPicker extends LinearLayout { return false; } - private void validateInputTextView(View v) { - String str = String.valueOf(((TextView) v).getText()); + private void validateInputTextView(NumberPickerEditText v) { + String str = String.valueOf(v.getText()); if (TextUtils.isEmpty(str)) { updateInputTextView(); } else {
Fix crashing with using NumberPicker
diff --git a/Kwf/Rest/Controller/Model.php b/Kwf/Rest/Controller/Model.php index <HASH>..<HASH> 100644 --- a/Kwf/Rest/Controller/Model.php +++ b/Kwf/Rest/Controller/Model.php @@ -190,6 +190,8 @@ class Kwf_Rest_Controller_Model extends Zend_Rest_Controller $this->_fillRowInsert($row, $data); $this->_beforeInsert($row); $row->save(); + $this->_afterSave($row, $data); + $this->_afterInsert($row, $data); $this->view->data = $this->_loadDataFromRow($row); } @@ -226,6 +228,8 @@ class Kwf_Rest_Controller_Model extends Zend_Rest_Controller $this->_fillRow($row, $data); $this->_beforeUpdate($row); $row->save(); + $this->_afterSave($row, $data); + $this->_afterUpdate($row, $data); $this->view->data = $this->_loadDataFromRow($row); } @@ -250,4 +254,16 @@ class Kwf_Rest_Controller_Model extends Zend_Rest_Controller protected function _beforeDelete(Kwf_Model_Row_Interface $row) { } + + protected function _afterUpdate(Kwf_Model_Row_Interface $row, $data) + { + } + + protected function _afterInsert(Kwf_Model_Row_Interface $row, $data) + { + } + + protected function _afterSave(Kwf_Model_Row_Interface $row, $data) + { + } }
Rest API: add afterUpdate/Insert/Save methods that can be overridden to implement custom logic
diff --git a/maven-plugin/src/main/java/io/codearte/accurest/maven/GenerateTestsMojo.java b/maven-plugin/src/main/java/io/codearte/accurest/maven/GenerateTestsMojo.java index <HASH>..<HASH> 100644 --- a/maven-plugin/src/main/java/io/codearte/accurest/maven/GenerateTestsMojo.java +++ b/maven-plugin/src/main/java/io/codearte/accurest/maven/GenerateTestsMojo.java @@ -47,6 +47,9 @@ public class GenerateTestsMojo extends AbstractMojo { @Parameter private String ruleClassForTests; + @Parameter + private String nameSuffixForTests; + public void execute() throws MojoExecutionException, MojoFailureException { getLog().info("Generating server tests source code for Accurest contract verification"); @@ -58,6 +61,7 @@ public class GenerateTestsMojo extends AbstractMojo { config.setBasePackageForTests(basePackageForTests); config.setBaseClassForTests(baseClassForTests); config.setRuleClassForTests(ruleClassForTests); + config.setNameSuffixForTests(nameSuffixForTests); getLog().info(format("Using %s as test source directory", config.getGeneratedTestSourcesDir())); getLog().info(format("Using %s as base class for test classes", config.getBaseClassForTests()));
added nameSuffixForTests
diff --git a/mixbox/namespaces.py b/mixbox/namespaces.py index <HASH>..<HASH> 100644 --- a/mixbox/namespaces.py +++ b/mixbox/namespaces.py @@ -9,10 +9,20 @@ import copy from mixbox.vendor import six -# A convenience class which represents simplified XML namespace info, consisting -# of exactly one namespace URI, and an optional prefix and schema location URI. -# This is handy for building up big tables of namespace data. -Namespace = collections.namedtuple("Namespace", "name prefix schema_location") +_NamespaceTuple = collections.namedtuple("Namespace", + "name prefix schema_location") + + +class Namespace(_NamespaceTuple): + """A convenience class which represents simplified XML namespace info, + consisting of exactly one namespace URI, and an optional prefix and schema + location URI. This is handy for building up big tables of namespace data. + """ + def __new__(cls, name, prefix, schema_location=None): + """This essentially enables parameter defaulting behavior on a + namedtuple. Here, schema location need not be given when creating a + Namespace, and it will default to None.""" + return super(Namespace, cls).__new__(cls, name, prefix, schema_location) class DuplicatePrefixError(Exception):
Redefined namespaces.Namespace to be a subclass of namedtuple, with a custom __new__ to allow the schema_location field to be defaulted (to None).
diff --git a/nani.py b/nani.py index <HASH>..<HASH> 100644 --- a/nani.py +++ b/nani.py @@ -527,7 +527,7 @@ class _IndirectCompositeArrayViewMixin(object): return self._data.__len__() def __contains__(self, item): - return self._data.__contains__(self, item) + return item in self._data _MIXIN_ATTRIBUTES[_IndirectCompositeArrayViewMixin] = (
Fix a call to the wrong 'contains' implementation
diff --git a/pyvera/__init__.py b/pyvera/__init__.py index <HASH>..<HASH> 100755 --- a/pyvera/__init__.py +++ b/pyvera/__init__.py @@ -637,7 +637,10 @@ class VeraDimmer(VeraSwitch): ci = None sup = self.get_complex_value('SupportedColors') if sup is not None: - ci = [sup.split(',').index(c) for c in colors] + try: + ci = [sup.split(',').index(c) for c in colors] + except (TypeError, ValueError, IndexError): + pass return ci def get_color(self, refresh=False): @@ -652,8 +655,11 @@ class VeraDimmer(VeraSwitch): ci = self.get_color_index(['R', 'G', 'B'], refresh) cur = self.get_complex_value('CurrentColor') if ci is not None and cur is not None: - val = [cur.split(',')[c] for c in ci] - rgb = [int(v.split('=')[1]) for v in val] + try: + val = [cur.split(',')[c] for c in ci] + rgb = [int(v.split('=')[1]) for v in val] + except (TypeError, ValueError, IndexError): + pass return rgb def set_color(self, rgb):
Catch errors when trying to parse RGB colors
diff --git a/datadog_checks_dev/datadog_checks/dev/tooling/commands/validate/config.py b/datadog_checks_dev/datadog_checks/dev/tooling/commands/validate/config.py index <HASH>..<HASH> 100644 --- a/datadog_checks_dev/datadog_checks/dev/tooling/commands/validate/config.py +++ b/datadog_checks_dev/datadog_checks/dev/tooling/commands/validate/config.py @@ -1,6 +1,8 @@ # (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) +import difflib + import click import yaml @@ -123,6 +125,12 @@ def config(ctx, check, sync, verbose): else: files_failed[example_file_path] = True message = f'File `{example_file}` is not in sync, run "ddev validate config -s"' + if file_exists(example_file_path): + example_file = read_file(example_file_path) + for diff_line in difflib.context_diff( + example_file.splitlines(), contents.splitlines(), "current", "expected" + ): + message += f'\n{diff_line}' check_display_queue.append( lambda example_file=example_file, **kwargs: echo_failure(message, **kwargs) )
Print the diff when the example file isn't in sync with the spec (#<I>)
diff --git a/linkcheck/configuration/__init__.py b/linkcheck/configuration/__init__.py index <HASH>..<HASH> 100644 --- a/linkcheck/configuration/__init__.py +++ b/linkcheck/configuration/__init__.py @@ -168,10 +168,14 @@ class Configuration (dict): logging.config.fileConfig(filename) if handler is None: handler = ansicolor.ColoredStreamHandler(strm=sys.stderr) - handler.setFormatter(logging.Formatter("%(levelname)s %(message)s")) logging.getLogger(LOG_ROOT).addHandler(handler) self.set_debug(debug) self.status_logger = status_logger + if self['threads'] > 0: + format = "%(levelname)s %(threadName)s %(message)s" + else: + format = "%(levelname)s %(message)s" + handler.setFormatter(logging.Formatter(format)) def set_debug (self, debug): """Set debugging levels for configured loggers. The argument
Add thread name to log output when threads are enabled.
diff --git a/tests/test_fread_small.py b/tests/test_fread_small.py index <HASH>..<HASH> 100644 --- a/tests/test_fread_small.py +++ b/tests/test_fread_small.py @@ -54,3 +54,11 @@ def test_empty_strings(seed, repl): assert d1.topython() == src +def test_select_some_columns(): + # * Last field of last line contains separator + # * The file doesn't end with \n + # * Only subset of columns is requested + f = dt.fread(text='A,B,C\n1,2,"a,b"', columns={'A', 'B'}) + assert f.internal.check() + assert f.names == ("A", "B") + assert f.topython() == [[1], [2]]
Add a test for fread (#<I>)
diff --git a/packages/razzle-dev-utils/makeLoaderFinder.js b/packages/razzle-dev-utils/makeLoaderFinder.js index <HASH>..<HASH> 100644 --- a/packages/razzle-dev-utils/makeLoaderFinder.js +++ b/packages/razzle-dev-utils/makeLoaderFinder.js @@ -6,7 +6,7 @@ const makeLoaderFinder = loaderName => rule => { // Checks if there's a loader string in rule.loader matching loaderRegex. const inLoaderString = - typeof rule.loader === 'string' && rule.loader.match(loaderRegex); + typeof rule.loader === 'string' && (rule.loader.match(loaderRegex) || rule.loader === loaderName); // Checks if there is an object inside rule.use with loader matching loaderRegex, OR // Checks another condition, if rule is not an object, but pure string (ex: "style-loader", etc) @@ -15,8 +15,8 @@ const makeLoaderFinder = loaderName => rule => { rule.use.find( loader => (typeof loader.loader === 'string' && - loader.loader.match(loaderRegex)) || - (typeof loader === 'string' && loader.match(loaderRegex)) + (loader.loader.match(loaderRegex)) || rule.loader === loaderName) || + (typeof loader === 'string' && (loader.match(loaderRegex) || loader === loaderName)) ); return inUseArray || inLoaderString;
fix: allow getting string only loaders
diff --git a/client-hc/src/test/java/com/graphhopper/api/GraphHopperMatrixIT.java b/client-hc/src/test/java/com/graphhopper/api/GraphHopperMatrixIT.java index <HASH>..<HASH> 100644 --- a/client-hc/src/test/java/com/graphhopper/api/GraphHopperMatrixIT.java +++ b/client-hc/src/test/java/com/graphhopper/api/GraphHopperMatrixIT.java @@ -59,7 +59,7 @@ public class GraphHopperMatrixIT { req.addOutArray("distances"); res = ghMatrix.route(req); - assertEquals(9970, res.getDistance(1, 2), 100); + assertEquals(9828, res.getDistance(1, 2), 100); assertEquals(1940, res.getWeight(1, 2), 20); }
Fix expected distance value in GraphHopperMatrixIT (once again)
diff --git a/lib/reference/keywordSets.js b/lib/reference/keywordSets.js index <HASH>..<HASH> 100644 --- a/lib/reference/keywordSets.js +++ b/lib/reference/keywordSets.js @@ -562,6 +562,8 @@ keywordSets.mediaFeatureNames = uniteSets( "grid", "height", "hover", + "inverted-colors", + "light-level", "max-aspect-ratio", "max-color", "max-color-index", @@ -581,6 +583,8 @@ keywordSets.mediaFeatureNames = uniteSets( "overflow-block", "overflow-inline", "pointer", + "prefers-reduced-motion", + "prefers-reduced-transparency", "resolution", "scan", "scripting",
Fix level 5 media queries in media-feature-name-no-unknown (#<I>)
diff --git a/mod/workshop/view.php b/mod/workshop/view.php index <HASH>..<HASH> 100644 --- a/mod/workshop/view.php +++ b/mod/workshop/view.php @@ -391,6 +391,17 @@ case workshop::PHASE_CLOSED: print_collapsible_region_end(); } } + if (has_capability('mod/workshop:submit', $PAGE->context)) { + print_collapsible_region_start('', 'workshop-viewlet-ownsubmission', get_string('yoursubmission', 'workshop')); + echo $output->box_start('generalbox ownsubmission'); + if ($submission = $workshop->get_submission_by_author($USER->id)) { + echo $output->submission_summary($submission, true); + } else { + echo $output->container(get_string('noyoursubmission', 'workshop')); + } + echo $output->box_end(); + print_collapsible_region_end(); + } if (has_capability('mod/workshop:viewpublishedsubmissions', $workshop->context)) { if ($submissions = $workshop->get_published_submissions()) { print_collapsible_region_start('', 'workshop-viewlet-publicsubmissions', get_string('publishedsubmissions', 'workshop'));
Workshop: access to the own submission when the activity is closed
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -37,6 +37,7 @@ module.exports = function(grunt) { options: { exclude: 'test_venv', with_xunit: true, + verbose: false, xunit_file: 'nosetests.xml', }, src: 'test/fixtures', diff --git a/tasks/nose.js b/tasks/nose.js index <HASH>..<HASH> 100644 --- a/tasks/nose.js +++ b/tasks/nose.js @@ -77,7 +77,8 @@ module.exports = function(grunt) { }); for (var prop in options){ - if (!options.hasOwnProperty(prop)){ + // If it's a flag that's set to false, skip + if (!options.hasOwnProperty(prop) || options[prop] === false){ continue; } @@ -87,8 +88,6 @@ module.exports = function(grunt) { } // If the property is not a flag, add the desired option value - // We count the option as a flag if the property === true - // Note: Specifying false as a value will not exclude the flag, omit the option entirely to do so if (options[prop] !== true){ // If the option value is a file path, make sure it's relative the the process cwd, since
Make sure we don't fail on flags set to false. Closes #1.
diff --git a/tests/parser/ast_utils/test_ast_dict.py b/tests/parser/ast_utils/test_ast_dict.py index <HASH>..<HASH> 100644 --- a/tests/parser/ast_utils/test_ast_dict.py +++ b/tests/parser/ast_utils/test_ast_dict.py @@ -69,9 +69,7 @@ a: int128 "lineno": 2, "node_id": 2, "src": "1:1:0", - "type": "int128", }, - "type": "int128", "value": None, } diff --git a/vyper/compiler/output.py b/vyper/compiler/output.py index <HASH>..<HASH> 100644 --- a/vyper/compiler/output.py +++ b/vyper/compiler/output.py @@ -18,7 +18,7 @@ from vyper.warnings import ContractSizeLimitWarning def build_ast_dict(compiler_data: CompilerData) -> dict: ast_dict = { "contract_name": compiler_data.contract_name, - "ast": ast_to_dict(compiler_data.vyper_module_unfolded), + "ast": ast_to_dict(compiler_data.vyper_module), } return ast_dict
fix: AST output (#<I>) rollback changes to `-f ast` introduced in 3cbdf<I>bfd until `vyper_module_folded` is stable
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -27,9 +27,9 @@ setup( zip_safe=True, install_requires=[ 'setuptools', - 'six>=1.4', + 'six >= 1.4', 'lxml', - 'genshi', + 'genshi >= 0.7', 'pyjon.utils > 0.6', ], entry_points="""
Added requirement for Genshi >= <I>
diff --git a/js/src/responsive-nav.jquery.js b/js/src/responsive-nav.jquery.js index <HASH>..<HASH> 100755 --- a/js/src/responsive-nav.jquery.js +++ b/js/src/responsive-nav.jquery.js @@ -32,18 +32,28 @@ module.exports = (function($){ $wrapper = $( options.wrapperSelector ), $menuButton = $( options.menuButtonSelector ); - var closeNav = function() { - if( options.navType === 'dropdown' ){ - $this.slideUp(); - } - else{ - $wrapper.removeClass( options.menuOpenClass ); - } + function _closeNav() { $menuButton.removeClass( options.menuButtonActiveClass ); - menuOpen = false; + } + + function _closeDropdownNav() { + $this.slideUp(); + _closeNav(); + } + + function _closeOffCanvasNav() { + $wrapper.removeClass( options.menuOpenClass ); + _closeNav(); + } + + var closeNavStrategies = { + dropdown: _closeDropdownNav, + offCanvas: _closeOffCanvasNav, }; + var closeNav = closeNavStrategies[options.navType] || _closeOffCanvasNav; + var bodyClickFn = function(evt) { //if not nav container or a decendant of nav container if( !$this.is(evt.target) && $this.has(evt.target).length === 0 ) {
refactor: introduce closeNavStrategies abstraction
diff --git a/lib/Github/HttpClient/HttpClient.php b/lib/Github/HttpClient/HttpClient.php index <HASH>..<HASH> 100644 --- a/lib/Github/HttpClient/HttpClient.php +++ b/lib/Github/HttpClient/HttpClient.php @@ -168,7 +168,7 @@ class HttpClient implements HttpClientInterface $request = $this->createRequest($httpMethod, $path); $request->addHeaders($headers); if (count($parameters) > 0) { - $request->setContent(json_encode($parameters)); + $request->setContent(json_encode($parameters, JSON_FORCE_OBJECT)); } $hasListeners = 0 < count($this->listeners);
Force object-form when encoding json for sending as POST body
diff --git a/test/cacheable-request.js b/test/cacheable-request.js index <HASH>..<HASH> 100644 --- a/test/cacheable-request.js +++ b/test/cacheable-request.js @@ -66,6 +66,22 @@ test.cb('cacheableRequest emits response event for network responses', t => { }); }); +test.cb('cacheableRequest emits response event for cached responses', t => { + const cache = new Map(); + const opts = Object.assign(url.parse(s.url), { cache }); + cacheableRequest(request, opts, () => { + // This needs to happen in next tick so cache entry has time to be stored + setImmediate(() => { + cacheableRequest(request, opts) + .on('request', req => req.end()) + .on('response', response => { + t.true(response.fromCache); + t.end(); + }); + }); + }).on('request', req => req.end()); +}); + test.after('cleanup', async () => { await s.close(); });
Test cacheableRequest emits response event for cached responses
diff --git a/tests/junit/org/jgroups/tests/ReconciliationTest.java b/tests/junit/org/jgroups/tests/ReconciliationTest.java index <HASH>..<HASH> 100644 --- a/tests/junit/org/jgroups/tests/ReconciliationTest.java +++ b/tests/junit/org/jgroups/tests/ReconciliationTest.java @@ -19,7 +19,7 @@ import java.util.Map; * configured to use FLUSH * * @author Bela Ban - * @version $Id: ReconciliationTest.java,v 1.15 2008/06/09 12:54:13 belaban Exp $ + * @version $Id: ReconciliationTest.java,v 1.16 2008/06/25 19:58:23 vlada Exp $ */ @Test(groups=Global.FLUSH,sequential=true) public class ReconciliationTest extends ChannelTestBase { @@ -58,7 +58,7 @@ public class ReconciliationTest extends ChannelTestBase { log.info("Joining D, this will trigger FLUSH and a subsequent view change to {A,B,C,D}"); JChannel newChannel; try { - newChannel=createChannel(); + newChannel=createChannel(channels.get(0)); newChannel.connect("x"); channels.add(newChannel); }
fix hanging flush-udp test
diff --git a/src/headful.js b/src/headful.js index <HASH>..<HASH> 100644 --- a/src/headful.js +++ b/src/headful.js @@ -47,6 +47,9 @@ headful.props = propertySetters; * Tests whether the given `props` object contains a property with the name of `propNameOrFunction`. */ function noProp(props, propNameOrFunction) { + if (!props) { + throw new Error('Headful: You must pass all declared props when you use headful.props.x() calls.'); + } const propName = typeof propNameOrFunction === 'function' ? propNameOrFunction.name : propNameOrFunction; return !props.hasOwnProperty(propName); }
Throw error when noProp() is being called without props argument
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityScheduler.java b/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityScheduler.java index <HASH>..<HASH> 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityScheduler.java +++ b/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityScheduler.java @@ -226,6 +226,7 @@ public class SingularityScheduler { if (!isRequestActive(maybeRequest)) { LOG.debug("Pending request {} was obsolete (request {})", pendingRequest, SingularityRequestWithState.getRequestState(maybeRequest)); obsoleteRequests++; + requestManager.deletePendingRequest(pendingRequest); continue; } @@ -234,6 +235,7 @@ public class SingularityScheduler { if (!shouldScheduleTasks(maybeRequest.get().getRequest(), pendingRequest, maybePendingDeploy, maybeRequestDeployState)) { LOG.debug("Pending request {} was obsolete (request {})", pendingRequest, SingularityRequestWithState.getRequestState(maybeRequest)); obsoleteRequests++; + requestManager.deletePendingRequest(pendingRequest); continue; }
make sure to remove obsolete pending requests
diff --git a/xchange-yobit/src/main/java/org/knowm/xchange/yobit/YoBitAdapters.java b/xchange-yobit/src/main/java/org/knowm/xchange/yobit/YoBitAdapters.java index <HASH>..<HASH> 100644 --- a/xchange-yobit/src/main/java/org/knowm/xchange/yobit/YoBitAdapters.java +++ b/xchange-yobit/src/main/java/org/knowm/xchange/yobit/YoBitAdapters.java @@ -107,7 +107,7 @@ public class YoBitAdapters { BigDecimal ask = ticker.getSell(); BigDecimal high = ticker.getHigh(); BigDecimal low = ticker.getLow(); - BigDecimal volume = ticker.getVol(); + BigDecimal volume = ticker.getVolCur(); Date timestamp = new Date(ticker.getUpdated() * 1000L); return new Ticker.Builder().currencyPair(currencyPair).last(last).bid(bid).ask(ask).high(high).low(low)
[#hotfix] Yobit volume should be in the base currency
diff --git a/logger/drain/drain.go b/logger/drain/drain.go index <HASH>..<HASH> 100644 --- a/logger/drain/drain.go +++ b/logger/drain/drain.go @@ -26,7 +26,7 @@ func SendToDrain(m string, drain string) error { func sendToSyslogDrain(m string, drain string) error { conn, err := net.Dial("udp", drain) if err != nil { - log.Fatal(err) + log.Print(err) } defer conn.Close() fmt.Fprintf(conn, m)
fix(logger): reduce severity of log failure Sending a log to an external server should not kill the logger on an error. For example, if the host is down or unavailable, the logger should just log that the error message has been lost, but carry on.
diff --git a/structr-ui/src/main/java/org/structr/web/importer/Importer.java b/structr-ui/src/main/java/org/structr/web/importer/Importer.java index <HASH>..<HASH> 100644 --- a/structr-ui/src/main/java/org/structr/web/importer/Importer.java +++ b/structr-ui/src/main/java/org/structr/web/importer/Importer.java @@ -306,7 +306,8 @@ public class Importer { return createChildNodes(body, null, page); } - return null; + // fallback, no head no body => document is parent + return createChildNodes(parsedDocument, null, page); } public DOMNode createChildNodes(final DOMNode parent, final Page page) throws FrameworkException {
Fixes import of shared components when using the non-cleaning XML parser instead of the HTML parser for deployment imports.
diff --git a/Octo/System/Store/SearchIndexStore.php b/Octo/System/Store/SearchIndexStore.php index <HASH>..<HASH> 100644 --- a/Octo/System/Store/SearchIndexStore.php +++ b/Octo/System/Store/SearchIndexStore.php @@ -40,7 +40,9 @@ class SearchIndexStore extends Octo\Store foreach ($res as $item) { $store = StoreFactory::get($item['model']); - $rtn[] = $store->getByPrimaryKey($item['content_id']); + if($store) { + $rtn[] = $store->getByPrimaryKey($item['content_id']); + } } }
Prevented search attempting to load stores that have been removed
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureImpl.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureImpl.java index <HASH>..<HASH> 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureImpl.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureImpl.java @@ -243,17 +243,17 @@ public class StructureImpl implements Structure, Serializable { /** {@inheritDoc} */ @Override - public Chain findChain(String chainId, int modelnr) throws StructureException { + public Chain findChain(String asymId, int modelnr) throws StructureException { List<Chain> chains = getChains(modelnr); // iterate over all chains. for (Chain c : chains) { - if (c.getName().equals(chainId)) { + if (c.getName().equals(asymId)) { return c; } } - throw new StructureException("Could not find chain \"" + chainId + "\" for PDB id " + pdb_id); + throw new StructureException("Could not find chain by asymId \"" + asymId + "\" for PDB id " + pdb_id); }
renaming variable name to be more clear
diff --git a/checkpoints.go b/checkpoints.go index <HASH>..<HASH> 100644 --- a/checkpoints.go +++ b/checkpoints.go @@ -57,6 +57,7 @@ var checkpointDataMainNet = checkpointData{ {216116, newShaHashFromStr("00000000000001b4f4b433e81ee46494af945cf96014816a4e2370f11b23df4e")}, {225430, newShaHashFromStr("00000000000001c108384350f74090433e7fcf79a606b8e797f065b130575932")}, {250000, newShaHashFromStr("000000000000003887df1f29024b06fc2200b55f8af8f35453d7be294df2d214")}, + {267300, newShaHashFromStr("000000000000000a83fbd660e918f218bf37edd92b748ad940483c7c116179ac")}, }, checkpointsByHeight: nil, // Automatically generated in init. }
Add checkpoint at block height <I>.
diff --git a/server/src/main/java/io/druid/initialization/Log4jShutterDownerModule.java b/server/src/main/java/io/druid/initialization/Log4jShutterDownerModule.java index <HASH>..<HASH> 100644 --- a/server/src/main/java/io/druid/initialization/Log4jShutterDownerModule.java +++ b/server/src/main/java/io/druid/initialization/Log4jShutterDownerModule.java @@ -45,8 +45,15 @@ public class Log4jShutterDownerModule implements Module // This makes the shutdown run pretty darn near last. try { + ClassLoader loader = Thread.currentThread().getContextClassLoader(); + if(loader == null) { + loader = getClass().getClassLoader(); + } // Reflection to try and allow non Log4j2 stuff to run. This acts as a gateway to stop errors in the next few lines - final Class<?> logManagerClazz = Class.forName("org.apache.logging.log4j.LogManager"); + // In log4j api + final Class<?> logManagerClazz = Class.forName("org.apache.logging.log4j.LogManager", false, loader); + // In log4j core + final Class<?> callbackRegistryClazz = Class.forName("org.apache.logging.log4j.core.util.ShutdownCallbackRegistry", false, loader); final LoggerContextFactory contextFactory = LogManager.getFactory(); if (!(contextFactory instanceof Log4jContextFactory)) {
Add check for log4j-core in Log4jShutterDownerModule
diff --git a/spatialist/__init__.py b/spatialist/__init__.py index <HASH>..<HASH> 100644 --- a/spatialist/__init__.py +++ b/spatialist/__init__.py @@ -9,4 +9,9 @@ from .vector import Vector, bbox, centerdist, intersect from .raster import Raster, stack, rasterize from .sqlite_util import sqlite_setup, sqlite3 -__version__ = '0.2.9' +from pkg_resources import get_distribution, DistributionNotFound +try: + __version__ = get_distribution(__name__).version +except DistributionNotFound: + # package is not installed + pass
[__init__] read version via pkg_resources
diff --git a/mopidy_spotify/translator.py b/mopidy_spotify/translator.py index <HASH>..<HASH> 100644 --- a/mopidy_spotify/translator.py +++ b/mopidy_spotify/translator.py @@ -32,6 +32,9 @@ def to_playlist(sp_playlist, folders=None, username=None): return name = sp_playlist.name + if name is None: + name = 'Starred' + # TODO Reverse order of tracks in starred playlists? if folders is not None: name = '/'.join(folders + [name]) if username is not None and sp_playlist.owner.canonical_name != username: diff --git a/tests/test_translator.py b/tests/test_translator.py index <HASH>..<HASH> 100644 --- a/tests/test_translator.py +++ b/tests/test_translator.py @@ -63,6 +63,14 @@ def test_to_playlist(sp_track_mock, sp_playlist_mock): assert playlist.last_modified is None +def test_to_playlist_adds_name_for_starred_playlists(sp_playlist_mock): + sp_playlist_mock.name = None + + playlist = translator.to_playlist(sp_playlist_mock) + + assert playlist.name == 'Starred' + + def test_to_playlist_filters_out_none_tracks(sp_track_mock, sp_playlist_mock): sp_track_mock.is_loaded = False playlist = translator.to_playlist(sp_playlist_mock)
Give a name to starred playlists
diff --git a/telemetry/telemetry/page/page_test_results.py b/telemetry/telemetry/page/page_test_results.py index <HASH>..<HASH> 100644 --- a/telemetry/telemetry/page/page_test_results.py +++ b/telemetry/telemetry/page/page_test_results.py @@ -9,6 +9,7 @@ class PageTestResults(unittest.TestResult): def __init__(self): super(PageTestResults, self).__init__() self.successes = [] + self.skipped = [] def addError(self, test, err): if isinstance(test, unittest.TestCase): @@ -23,7 +24,10 @@ class PageTestResults(unittest.TestResult): self.failures.append((test, ''.join(traceback.format_exception(*err)))) def addSuccess(self, test): - self.successes += test + self.successes.append(test) + + def addSkip(self, test, reason): # Python 2.7 has this in unittest.TestResult + self.skipped.append((test, reason)) def AddError(self, page, err): self.addError(page.url, err)
[telemetry] Add skipped and addSkip() to PageTestResults, for Python < <I>. Fixing bots after <URL>. successes is only used by record_wpr, so that mistake had no effect on the bots. TBR=<EMAIL> BUG=None. TEST=None. Review URL: <URL>