diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/lib/route53.rb b/lib/route53.rb index <HASH>..<HASH> 100644 --- a/lib/route53.rb +++ b/lib/route53.rb @@ -305,7 +305,7 @@ module Route53 @name += "." end @type = type - @ttl = ttl + @ttl = ttl.upcase @values = values @zone = zone end
Upcasing type as per suggestion from electrum for Issue: 3.
diff --git a/lib/rib/zore/rails.rb b/lib/rib/zore/rails.rb index <HASH>..<HASH> 100644 --- a/lib/rib/zore/rails.rb +++ b/lib/rib/zore/rails.rb @@ -12,9 +12,9 @@ module Rib::Rails module_function def load_rails - require "#{Dir.pwd}/config/boot" + require './config/boot' - if File.exist?("#{Dir.pwd}/config/application.rb") + if File.exist?('./config/application.rb') Rib::Rails.load_rails3 else Rib::Rails.load_rails2 @@ -27,14 +27,14 @@ module Rib::Rails end def load_rails2 - ["#{Dir.pwd}/config/environment", - 'console_app', + ['./config/environment', + 'console_app' , 'console_with_helpers'].each{ |f| require f } end def load_rails3 - ["#{Dir.pwd}/config/application", - 'rails/console/app', + ['./config/application', + 'rails/console/app' , 'rails/console/helpers'].each{ |f| require f } ::Rails.application.require_environment!
rails.rb: easier to read
diff --git a/tests/support/helpers.py b/tests/support/helpers.py index <HASH>..<HASH> 100644 --- a/tests/support/helpers.py +++ b/tests/support/helpers.py @@ -201,7 +201,7 @@ def flaky(caller=None, condition=True): try: return caller(cls) except Exception as exc: - if attempt == 4: + if attempt >= 3: raise exc backoff_time = attempt ** 2 log.info('Found Exception. Waiting %s seconds to retry.', backoff_time)
calling range is going up to the upper limit but not including it
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/manual_measures_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/manual_measures_controller.rb index <HASH>..<HASH> 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/manual_measures_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/manual_measures_controller.rb @@ -46,6 +46,7 @@ class ManualMeasuresController < ApplicationController end @measure.typed_value=params[:val] @measure.description=params[:desc] + @measure.user_login=current_user.login if @measure.valid? @measure.save if (params[:redirect_to_new]=='true')
SONAR-<I> Save last user who edited a manual measure => On manual measures, "Last change by" field is never updated
diff --git a/lib/esm-utils.js b/lib/esm-utils.js index <HASH>..<HASH> 100644 --- a/lib/esm-utils.js +++ b/lib/esm-utils.js @@ -34,7 +34,9 @@ const hasStableEsmImplementation = (() => { const [major, minor] = process.version.split('.'); // ESM is stable from v12.22.0 onward // https://nodejs.org/api/esm.html#esm_modules_ecmascript_modules - return parseInt(major.slice(1), 10) > 12 || parseInt(minor, 10) >= 22; + const majorNumber = parseInt(major.slice(1), 10); + const minorNumber = parseInt(minor, 10); + return majorNumber > 12 || (majorNumber === 12 && minorNumber >= 22); })(); exports.requireOrImport = hasStableEsmImplementation
ESM: proper version check in hasStableEsmImplementation (#<I>)
diff --git a/acceptance/lifecycle_test.go b/acceptance/lifecycle_test.go index <HASH>..<HASH> 100644 --- a/acceptance/lifecycle_test.go +++ b/acceptance/lifecycle_test.go @@ -329,7 +329,7 @@ var _ = Describe("bosh-micro", func() { println("#################################################") stdout = deploy() - Expect(stdout).To(ContainSubstring("No deployment, stemcell or cpi release changes. Skipping deploy.")) + Expect(stdout).To(ContainSubstring("No deployment, stemcell or release changes. Skipping deploy.")) Expect(stdout).ToNot(ContainSubstring("Started installing CPI jobs")) Expect(stdout).ToNot(ContainSubstring("Started deploying"))
Fixes acceptance test for duplicate deployment failure message. [Fixes #<I>]
diff --git a/lib/RMagick.rb b/lib/RMagick.rb index <HASH>..<HASH> 100644 --- a/lib/RMagick.rb +++ b/lib/RMagick.rb @@ -1,4 +1,4 @@ -# $Id: RMagick.rb,v 1.75 2008/09/28 00:24:41 rmagick Exp $ +# $Id: RMagick.rb,v 1.76 2008/10/27 22:17:54 rmagick Exp $ #============================================================================== # Copyright (C) 2008 by Timothy P. Hunter # Name: RMagick.rb @@ -1576,11 +1576,11 @@ public end # Initialize new instances - def initialize(*filenames) + def initialize(*filenames, &block) @images = [] @scene = nil filenames.each { |f| - Magick::Image.read(f).each { |n| @images << n } + Magick::Image.read(f, &block).each { |n| @images << n } } if length > 0 @scene = length - 1 # last image in array
Let ImageList::new accept a block which is passes on to Image::read.
diff --git a/core/corehttp/metrics_test.go b/core/corehttp/metrics_test.go index <HASH>..<HASH> 100644 --- a/core/corehttp/metrics_test.go +++ b/core/corehttp/metrics_test.go @@ -46,7 +46,7 @@ func TestPeersTotal(t *testing.T) { collector := IpfsNodeCollector{Node: node} actual := collector.PeersTotalValues() if len(actual) != 1 { - t.Fatalf("expected 1 peers transport, got %d", len(actual)) + t.Fatalf("expected 1 peers transport, got %d, transport map %v", len(actual), actual) } if actual["/ip4/tcp"] != float64(3) { t.Fatalf("expected 3 peers, got %f", actual["/ip4/tcp"])
add more logging to flaky TestPeersTotal Cannot reproduce the flakiness at the moment. The report suggests that connections are established on different transports. Adding logging to show what these transports are.
diff --git a/isambard_dev/ampal/non_canonical.py b/isambard_dev/ampal/non_canonical.py index <HASH>..<HASH> 100644 --- a/isambard_dev/ampal/non_canonical.py +++ b/isambard_dev/ampal/non_canonical.py @@ -8,7 +8,8 @@ import numpy from tools.geometry import dihedral, find_transformations -REF_PATH = pathlib.Path('reference_ampals', 'non_canonical_amino_acids') +FILE_PATH = pathlib.Path(__file__).parent +REF_PATH = FILE_PATH / 'reference_ampals' / 'non_canonical_amino_acids' def convert_pro_to_hyp(pro): @@ -23,7 +24,7 @@ def convert_pro_to_hyp(pro): pro: ampal.Residue The proline residue to be mutated to hydroxyproline. """ - with open(REF_PATH + 'hydroxyproline_ref_1bkv_0_6.pickle', 'rb') as inf: + with open(REF_PATH / 'hydroxyproline_ref_1bkv_0_6.pickle', 'rb') as inf: hyp_ref = pickle.load(inf) align_nab(hyp_ref, pro) to_remove = ['CB', 'CG', 'CD']
Fixes paths for reference files.
diff --git a/ldap_sync/management/commands/syncldap.py b/ldap_sync/management/commands/syncldap.py index <HASH>..<HASH> 100644 --- a/ldap_sync/management/commands/syncldap.py +++ b/ldap_sync/management/commands/syncldap.py @@ -11,6 +11,7 @@ from django.contrib.auth.models import Group from django.core.exceptions import ImproperlyConfigured from django.db import DataError from django.db import IntegrityError +from django.utils.module_loading import import_string logger = logging.getLogger(__name__) @@ -100,6 +101,12 @@ class Command(BaseCommand): updated = True if updated: logger.debug("Updated user %s" % username) + + callbacks = list(getattr(settings, 'LDAP_SYNC_USER_CALLBACKS', [])) + for path in callbacks: + callback = import_string(path) + user = callback(user, created, updated) + user.save() if removed_user_action in ['DEACTIVATE', 'DELETE']:
Add custom callbacks for each processed user
diff --git a/proso_user/api_test.py b/proso_user/api_test.py index <HASH>..<HASH> 100644 --- a/proso_user/api_test.py +++ b/proso_user/api_test.py @@ -32,8 +32,11 @@ class UserAPITest(TestCase): "id": 1, "public": False } + response = json.loads(response.content)['data'] + expected_profile["user"]["id"] = response["user"]["id"] + expected_profile["id"] = response["id"] self.assertEqual( - json.loads(response.content)['data'], expected_profile, + response, expected_profile, 'The given profile has been created.' ) # check profile
fix user api test - ignore user id and profile id
diff --git a/client/base.js b/client/base.js index <HASH>..<HASH> 100644 --- a/client/base.js +++ b/client/base.js @@ -145,6 +145,14 @@ var Client = Class.extend({ } function end(err) { + if (!err && params.defer) { + return params.defer(result, function (e, r) { + params.defer = null; + result = r || result; + end(e); + }); + } + if (err && params.error) { params.error(err, xhr); }
Allows a defer callback for a request
diff --git a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php @@ -20,7 +20,7 @@ namespace Doctrine\ORM\Tools\Console\Command\SchemaTool; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Tools\SchemaTool; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; @@ -53,7 +53,7 @@ abstract class AbstractCommand extends Command $emHelper = $this->getHelper('em'); $em = $emHelper->getEntityManager(); - assert($em instanceof EntityManager); + assert($em instanceof EntityManagerInterface); $metadatas = $em->getMetadataFactory()->getAllMetadata();
Relax assertion (#<I>) EntityManager is too restrictive, any implementation can actually be returned here. Closes #<I>
diff --git a/lib/mongo_mapper/plugins/querying.rb b/lib/mongo_mapper/plugins/querying.rb index <HASH>..<HASH> 100644 --- a/lib/mongo_mapper/plugins/querying.rb +++ b/lib/mongo_mapper/plugins/querying.rb @@ -54,6 +54,7 @@ module MongoMapper query.model(self) query end + alias_method :scoped, :query # @api private for now def criteria_hash(criteria={}) diff --git a/spec/functional/querying_spec.rb b/spec/functional/querying_spec.rb index <HASH>..<HASH> 100644 --- a/spec/functional/querying_spec.rb +++ b/spec/functional/querying_spec.rb @@ -993,4 +993,11 @@ describe "Querying" do user.first_name.should == "John" end end + + context "#scoped" do + it "should return a Query" do + document.scoped.should be_a MongoMapper::Plugins::Querying::DecoratedPluckyQuery + document.scoped.criteria_hash.should be_empty + end + end end
Add #scoped for AR 3.x parity
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -108,7 +108,7 @@ function runTest(responseText, expectedEvents, expectedError) { const expectedHeaders = { // "content-type": "application/json", // there's no request body, so no content-type - "authorization": "JWT foo" + "authorization": "Bearer foo" }; assertEquals(JSON.stringify(createdXMLHttpRequest.headers), JSON.stringify(expectedHeaders), "should send json request with auth token");
update test to expect Bearer, not JWT, in Authorization header
diff --git a/bcloud/MimeProvider.py b/bcloud/MimeProvider.py index <HASH>..<HASH> 100644 --- a/bcloud/MimeProvider.py +++ b/bcloud/MimeProvider.py @@ -74,6 +74,8 @@ class MimeProvider: def get_app_img(self, app_info): themed_icon = app_info.get_icon() + if isinstance(themed_icon, Gio.FileIcon): + return None icon_names = themed_icon.get_names() if icon_names: img = Gtk.Image.new_from_icon_name(
Fixed: AttributeError: 'FileIcon' object has no attribute 'get_names'; reported by @ahwad
diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/HttpContentEncoder.java b/codec-http/src/main/java/io/netty/handler/codec/http/HttpContentEncoder.java index <HASH>..<HASH> 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/HttpContentEncoder.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/HttpContentEncoder.java @@ -123,15 +123,13 @@ public abstract class HttpContentEncoder extends MessageToMessageCodec<HttpReque // If unable to encode, pass through. if (result == null) { if (isFull) { - // As an unchunked response + // Set the content length. res.headers().remove(Names.TRANSFER_ENCODING); res.headers().set(Names.CONTENT_LENGTH, ((ByteBufHolder) res).content().readableBytes()); out.add(ReferenceCountUtil.retain(res)); } else { - // As a chunked response - res.headers().remove(Names.CONTENT_LENGTH); - res.headers().set(Names.TRANSFER_ENCODING, Values.CHUNKED); out.add(res); + // Pass through all following contents. state = State.PASS_THROUGH; } break;
HttpContentEncoder should not remove Content-Length when acting as a passthrough.
diff --git a/lib/softlayer/ProductItemCategory.rb b/lib/softlayer/ProductItemCategory.rb index <HASH>..<HASH> 100644 --- a/lib/softlayer/ProductItemCategory.rb +++ b/lib/softlayer/ProductItemCategory.rb @@ -14,7 +14,7 @@ module SoftLayer # DEPRECATION WARNING: The following configuration option keys have been deprecated and # will be removed with the next major version: capacityRestrictionMaximum, capacityRestrictionMinimum, # capacityRestrictionType, hourlyRecurringFee, laborFee, oneTimeFee, recurringFee, requiredCoreCount, setupFee - class ProductConfigurationOption < Struct.new(:capacity, :capacityRestrictionMaximum, :capicity_restriction_maximum, + class ProductConfigurationOption < Struct.new(:capacity, :capacityRestrictionMaximum, :capacity_restriction_maximum, :capacityRestrictionMinimum, :capacity_restriction_minimum, :capacityRestrictionType, :capacity_restriction_type, :description, :hourlyRecurringFee, :hourly_recurring_fee, :laborFee, :labor_fee, :oneTimeFee, :one_time_fee, :price_id, :recurringFee, :recurring_fee, :requiredCoreCount, :required_core_count, :setupFee, :setup_fee, :units)
Fixed a spelling error in a compatibility symbol
diff --git a/lib/resource/detail.js b/lib/resource/detail.js index <HASH>..<HASH> 100644 --- a/lib/resource/detail.js +++ b/lib/resource/detail.js @@ -109,7 +109,7 @@ var MyResource = new Class({ if( err ){ err.req = bundle.req; err.res = bundle.res; - return that.emit( 'err', err ); + return that.emit( 'error', err ); } if( !that.options.returnData ){
Fix bad error event from patch_detail Should emit error event, not err
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -181,15 +181,6 @@ gulp.task("lint", () => { .pipe(jshint.reporter("default")); }); -gulp.task("webserver", () => { - gulp.src("publish/") - .pipe(webserver({ - port: 8000, - livereload: true, - directoryListing: true - })); -}); - gulp.task("clean-jsdoc", (done) => { return del([ "publish/jsdoc/" ], done); }); @@ -212,6 +203,15 @@ gulp.task("build-demo", [ "clean-demo", "copy-demo" ], () => { return bower({ cwd: 'publish/demo/' }); }); +gulp.task("webserver", [ "build-demo", "jsdoc" ], () => { + gulp.src("publish/") + .pipe(webserver({ + port: 8000, + livereload: true, + directoryListing: true + })); +}); + gulp.task("deploy", [ "build-demo", "jsdoc" ], () => { return gulp.src('publish/**/*') .pipe(ghPages());
chore(gulp): kick "build-demo" and "jsdoc" task before starting "webserver" task
diff --git a/master/buildbot/test/util/db.py b/master/buildbot/test/util/db.py index <HASH>..<HASH> 100644 --- a/master/buildbot/test/util/db.py +++ b/master/buildbot/test/util/db.py @@ -79,9 +79,7 @@ class RealDatabaseMixin(object): self.__want_pool = want_pool memory = 'sqlite://' - self.db_url = os.environ.get('BUILDBOT_TEST_DB_URL', - ### XXX TEMPORARY until sqlalchemification is complete - 'sqlite:///%s' % (os.path.abspath('test.db'))) + self.db_url = os.environ.get('BUILDBOT_TEST_DB_URL', memory) self.__using_memory_db = (self.db_url == memory) self.db_engine = enginestrategy.create_engine(self.db_url,
use in-memory database for testing
diff --git a/widgets/TbGroupButtonColumn.php b/widgets/TbGroupButtonColumn.php index <HASH>..<HASH> 100644 --- a/widgets/TbGroupButtonColumn.php +++ b/widgets/TbGroupButtonColumn.php @@ -40,7 +40,15 @@ class TbGroupButtonColumn extends CButtonColumn else if (!preg_match('/[^A-z\-]btn[^A-z\-]/', $options['class'])) $options['class'] = 'btn '.$options['class']; - echo CHtml::link($label, $url, $options); + if (isset($button['icon'])) + { + if (strpos($button['icon'], 'icon') === false) + $button['icon'] = 'icon-'.implode(' icon-', explode(' ', $button['icon'])); + + echo CHtml::link('<i class="'.$button['icon'].'"></i>', $url, $options); + } + else + echo CHtml::link($label, $url, $options); } /**
Enable buttons with icons instead of text
diff --git a/dbussy.py b/dbussy.py index <HASH>..<HASH> 100644 --- a/dbussy.py +++ b/dbussy.py @@ -3433,7 +3433,7 @@ class _MsgAiter : #end _MsgAiter -class Server : +class Server(TaskKeeper) : "wrapper around a DBusServer object. Do not instantiate directly; use" \ " the listen method.\n" \ "\n" \ @@ -3443,11 +3443,12 @@ class Server : " use Connection.open() to connect to you on that address." # <https://dbus.freedesktop.org/doc/api/html/group__DBusServer.html> + # Doesn’t really need services of TaskKeeper for now, but might be + # useful in future + __slots__ = \ ( - "__weakref__", "_dbobj", - "loop", "_new_connections", "_await_new_connections", "max_new_connections", @@ -3472,8 +3473,8 @@ class Server : self = celf._instances.get(_dbobj) if self == None : self = super().__new__(celf) + super()._init(self) self._dbobj = _dbobj - self.loop = None self._new_connections = None self._await_new_connections = None self.max_new_connections = None
make Server also a subclass of TaskKeeper -- may be useful in future
diff --git a/lib/active_remote/typecasting/boolean_typecaster.rb b/lib/active_remote/typecasting/boolean_typecaster.rb index <HASH>..<HASH> 100644 --- a/lib/active_remote/typecasting/boolean_typecaster.rb +++ b/lib/active_remote/typecasting/boolean_typecaster.rb @@ -1,9 +1,12 @@ module ActiveRemote module Typecasting class BooleanTypecaster - FALSE_VALUES = ["n", "N", "no", "No", "NO", "false", "False", "FALSE", "off", "Off", "OFF", "f", "F"] + BOOL_VALUES = [true, false].freeze + FALSE_VALUES = ["n", "N", "no", "No", "NO", "false", "False", "FALSE", "off", "Off", "OFF", "f", "F"] def self.call(value) + return value if BOOL_VALUES.include?(value) + case value when *FALSE_VALUES then false when Numeric, /^\-?[0-9]/ then !value.to_f.zero?
accomodate booleans in the boolean typecaster
diff --git a/CHANGES b/CHANGES index <HASH>..<HASH> 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,12 @@ Statsd Changelog ================ +Version 2.1.1 +------------- + +- Fix issue with timers used as decorators. + + Version 2.1 ----------- diff --git a/statsd/client.py b/statsd/client.py index <HASH>..<HASH> 100644 --- a/statsd/client.py +++ b/statsd/client.py @@ -33,6 +33,8 @@ class Timer(object): self.stop() def start(self): + self.ms = None + self._sent = False self._start_time = time.time() return self diff --git a/statsd/tests.py b/statsd/tests.py index <HASH>..<HASH> 100644 --- a/statsd/tests.py +++ b/statsd/tests.py @@ -226,9 +226,12 @@ def test_timer_decorator(): pass bar() - _timer_check(sc, 1, 'bar', 'ms') + # Make sure the decorator works more than once: + bar() + _timer_check(sc, 2, 'bar', 'ms') + def test_timer_capture(): """You can capture the output of StatsClient.timer."""
Fix timers used as decorators.
diff --git a/pkg/util/trace.go b/pkg/util/trace.go index <HASH>..<HASH> 100644 --- a/pkg/util/trace.go +++ b/pkg/util/trace.go @@ -32,15 +32,19 @@ type traceStep struct { type Trace struct { name string startTime time.Time - steps []*traceStep + steps []traceStep } func NewTrace(name string) *Trace { - return &Trace{name, time.Now(), make([]*traceStep, 0)} + return &Trace{name, time.Now(), nil} } func (t *Trace) Step(msg string) { - t.steps = append(t.steps, &traceStep{time.Now(), msg}) + if t.steps == nil { + // traces almost always have less than 6 steps, do this to avoid more than a single allocation + t.steps = make([]traceStep, 0, 6) + } + t.steps = append(t.steps, traceStep{time.Now(), msg}) } func (t *Trace) Log() {
Trace.Step() performs an unnecessary ref Allocates more objects than necessary.
diff --git a/lib/deployml/project.rb b/lib/deployml/project.rb index <HASH>..<HASH> 100644 --- a/lib/deployml/project.rb +++ b/lib/deployml/project.rb @@ -57,6 +57,9 @@ module DeploYML # @option config [String, Hash] :dest # The destination URI to upload the project to. # + # @option config [String, Array<String>] :exclude + # File-path pattern or list of patterns to exclude from deployment. + # # @option config [Boolean] :debug # Specifies whether to enable debugging. # @@ -82,9 +85,17 @@ module DeploYML raise(InvalidConfig,":dest option must contain either a Hash or a String",caller) end + @exclude = Set[] + + case options[:exclude] + when Array + @exclude += options[:exclude] + when String + @exclude << options[:exclude] + end + @debug = config[:debug] @local_copy = File.join(Dir.pwd,LOCAL_COPY) - @exclude = Set[] extend SCMS[@scm]
Added the :exclude option to Project.new.
diff --git a/admin/code/AdminRootController.php b/admin/code/AdminRootController.php index <HASH>..<HASH> 100644 --- a/admin/code/AdminRootController.php +++ b/admin/code/AdminRootController.php @@ -89,5 +89,7 @@ class AdminRootController extends Controller { } } } + + return $this->httpError(404, 'Not found'); } }
MINOR Returning at least some error feedback when admin/* route isn't found (fixes #<I>)
diff --git a/lib/right_develop/utility/git.rb b/lib/right_develop/utility/git.rb index <HASH>..<HASH> 100644 --- a/lib/right_develop/utility/git.rb +++ b/lib/right_develop/utility/git.rb @@ -56,9 +56,9 @@ module RightDevelop::Utility::Git true end - # msysgit on Windows exits zero even when checkout|reset fails so we need to - # scan the output for error or fatal messages. it does no harm to do the same - # on Linux even though the exit code works properly there. + # msysgit on Windows exits zero even when checkout|reset|fetch fails so we + # need to scan the output for error or fatal messages. it does no harm to do + # the same on Linux even though the exit code works properly there. # # @param [String|Array] args to execute # @@ -192,8 +192,8 @@ module RightDevelop::Utility::Git # # @return [TrueClass] always true def fetch_all - spit_output('fetch') - spit_output('fetch --tags') # need a separate call to fetch tags + vet_output('fetch') + vet_output('fetch --tags') # need a separate call to fetch tags true end
acu<I> vetted fetch output because it exits nonzero with errors when it fails to connect to github
diff --git a/user/editlib.php b/user/editlib.php index <HASH>..<HASH> 100644 --- a/user/editlib.php +++ b/user/editlib.php @@ -223,7 +223,12 @@ function useredit_shared_definition(&$mform, $editoroptions = null) { if (!empty($CFG->allowuserthemes)) { $choices = array(); $choices[''] = get_string('default'); - $choices += get_list_of_themes(); + $themes = get_list_of_themes(); + foreach ($themes as $key=>$theme) { + if (empty($theme->hidefromselector)) { + $choices[$key] = $theme->name; + } + } $mform->addElement('select', 'theme', get_string('preferredtheme'), $choices); $mform->setAdvanced('theme'); }
user MDL-<I> Fixed incorrect use of get_list_of_themes in editlib.php
diff --git a/pew/pew.py b/pew/pew.py index <HASH>..<HASH> 100644 --- a/pew/pew.py +++ b/pew/pew.py @@ -18,9 +18,14 @@ except ImportError: from backports.shutil_get_terminal_size import get_terminal_size from clonevirtualenv import clone_virtualenv -from pythonz.commands.install import InstallCommand -from pythonz.commands.list import ListCommand as ListPythons -from pythonz.commands.locate import LocateCommand as LocatePython +try: + from pythonz.commands.install import InstallCommand + from pythonz.commands.list import ListCommand as ListPythons + from pythonz.commands.locate import LocateCommand as LocatePython +except KeyError: + # Pythonz is an interactive tool that requires a valid $HOME, for now we'll + # just ignore the Error to appease the CI environment + pass from pew import __version__ from pew._utils import (check_call, invoke, expandpath, own,
Ignore Error in the CI environment
diff --git a/etc/remark/plugins/lint/jsdoc.js b/etc/remark/plugins/lint/jsdoc.js index <HASH>..<HASH> 100644 --- a/etc/remark/plugins/lint/jsdoc.js +++ b/etc/remark/plugins/lint/jsdoc.js @@ -16,6 +16,8 @@ * limitations under the License. */ +/* eslint-disable stdlib/jsdoc-return-annotations-marker */ + 'use strict'; /**
Disable lint rule as examples are not JS
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/groups_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/groups_controller.rb index <HASH>..<HASH> 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/groups_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/groups_controller.rb @@ -81,11 +81,13 @@ class GroupsController < ApplicationController to_index(group.errors, nil) end + # TO BE REMOVED ? def select_user @group = Group.find(params[:id]) render :partial => 'groups/select_user' end + # TO BE REMOVED ? def set_users @group = Group.find(params[:id]) if @group.set_users(params[:users])
Mark two methods as unused in groups_controller.rb
diff --git a/src/main/java/si/mazi/rescu/AnnotationUtils.java b/src/main/java/si/mazi/rescu/AnnotationUtils.java index <HASH>..<HASH> 100644 --- a/src/main/java/si/mazi/rescu/AnnotationUtils.java +++ b/src/main/java/si/mazi/rescu/AnnotationUtils.java @@ -42,7 +42,7 @@ public final class AnnotationUtils { return null; } try { - return (String) ann.getClass().getMethod("value").invoke(ann); + return (String) ann.annotationType().getMethod("value").invoke(ann); } catch (Exception e) { throw new RuntimeException("Can't access element 'value' in " + annotationClass + ". This is probably a bug in rescu.", e); }
Use annotationType instead of getClass. Allows for Native image generation. (#<I>)
diff --git a/schema_salad/main.py b/schema_salad/main.py index <HASH>..<HASH> 100644 --- a/schema_salad/main.py +++ b/schema_salad/main.py @@ -284,7 +284,7 @@ def main(argsl=None): # type: (List[str]) -> int # Optionally print the RDFS graph from the schema if args.print_rdfs: - print(rdfs.serialize(format=args.rdf_serializer)) + print(rdfs.serialize(format=args.rdf_serializer).decode('utf-8')) return 0 if args.print_metadata and not args.document:
fix printing of rdfs under py3 (#<I>)
diff --git a/test/unit/voldemort/store/routed/RoutedStoreTest.java b/test/unit/voldemort/store/routed/RoutedStoreTest.java index <HASH>..<HASH> 100644 --- a/test/unit/voldemort/store/routed/RoutedStoreTest.java +++ b/test/unit/voldemort/store/routed/RoutedStoreTest.java @@ -36,7 +36,6 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; -import voldemort.MockTime; import voldemort.ServerTestUtils; import voldemort.TestUtils; import voldemort.VoldemortException; @@ -60,6 +59,7 @@ import voldemort.store.UnreachableStoreException; import voldemort.store.memory.InMemoryStorageEngine; import voldemort.store.versioned.InconsistencyResolvingStore; import voldemort.utils.ByteArray; +import voldemort.utils.SystemTime; import voldemort.utils.Time; import voldemort.utils.Utils; import voldemort.versioning.Occured; @@ -96,7 +96,7 @@ public class RoutedStoreTest extends AbstractByteArrayStoreTest { public void setUp() throws Exception { super.setUp(); cluster = getNineNodeCluster(); - time = new MockTime(); + time = SystemTime.INSTANCE; } @Override
Using system time for unit test as mock time doesn't appear to be working.
diff --git a/presto-main/src/main/java/com/facebook/presto/operator/TableWriterOperator.java b/presto-main/src/main/java/com/facebook/presto/operator/TableWriterOperator.java index <HASH>..<HASH> 100644 --- a/presto-main/src/main/java/com/facebook/presto/operator/TableWriterOperator.java +++ b/presto-main/src/main/java/com/facebook/presto/operator/TableWriterOperator.java @@ -129,8 +129,7 @@ public class TableWriterOperator protected void doClose() { if (!closed.getAndSet(true)) { - checkState(!sourceIterator.hasNext(), "writer closed with source iterator still having data!"); - + checkState(operatorStats.isDone() || !sourceIterator.hasNext(), "Writer was closed while source iterator still has data and the operator is not done!"); commitFileHandle(fileHandle); sourceIterator.close(); output.set(ImmutableSet.of(new TableWriterResult(input.get().getShardId(), nodeIdentifier)));
Fix close exception in table writer. Only report a bad close (with sources still left) if it was not caused by the operatorStats declare the query done anyway.
diff --git a/app/models/effective/effective_datatable/format.rb b/app/models/effective/effective_datatable/format.rb index <HASH>..<HASH> 100644 --- a/app/models/effective/effective_datatable/format.rb +++ b/app/models/effective/effective_datatable/format.rb @@ -113,12 +113,30 @@ module Effective # Takes all default resource actions # Applies data-remote to anything that's data-method post or delete + # Merges in any extra attributes when passed as a Hash def actions_col_actions(column) - if column[:inline] + actions = if column[:inline] resource.resource_actions.transform_values { |opts| opts['data-remote'] = true; opts } else resource.resource_actions.transform_values { |opts| opts['data-remote'] = true if opts['data-method']; opts } end + + # Merge local options. Special behaviour for remote: false + if column[:actions].kind_of?(Hash) + column[:actions].each do |action, opts| + next unless opts.kind_of?(Hash) + + existing = actions.find { |_, v| v[:action] == action }.first + next unless existing.present? + + actions[existing]['data-remote'] = opts[:remote] if opts.key?(:remote) + actions[existing]['data-remote'] = opts['remote'] if opts.key?('remote') + + actions[existing].merge!(opts.except(:remote, 'remote')) + end + end + + actions end def resource_col_locals(opts)
Pass a Hash of options to actions_col
diff --git a/lib/pm.js b/lib/pm.js index <HASH>..<HASH> 100644 --- a/lib/pm.js +++ b/lib/pm.js @@ -71,6 +71,14 @@ Pm.prototype.spawn = function(callback) { mkdirp(this.base); + try { + fs.truncateSync(this.logFile, 0); + } catch (er) { + // Ignore, probably the file doesn't exist, and other errors + // will be caught below when we open the file. + debug('truncate failed: %s', er.message); + } + var logFd = fs.openSync(this.logFile, 'a'); var options = { detached: true, @@ -79,8 +87,6 @@ Pm.prototype.spawn = function(callback) { debug('spawn: %s args %j options %j', process.execPath, args, options); - fs.ftruncateSync(logFd, 0); - self.child = spawn(process.execPath, args, options) .once('error', function(err) { debug('spawn error: %s', err);
pm: truncate start.log before opening Its more efficient to open once and truncate after, but Windows doesn't support this for files opened in append mode, and we don't really care what the order is.
diff --git a/lib/creek/sheet.rb b/lib/creek/sheet.rb index <HASH>..<HASH> 100644 --- a/lib/creek/sheet.rb +++ b/lib/creek/sheet.rb @@ -116,7 +116,8 @@ module Creek cell = node.attributes['r'] elsif (['v', 't'].include? node.name) and (node.node_type.eql? opener) unless cell.nil? - cells[(use_simple_rows_format ? cell.tr("0-9", "") : cell)] = convert(node.inner_xml, cell_type, cell_style_idx) + node.read + cells[(use_simple_rows_format ? cell.tr("0-9", "") : cell)] = convert(node.value, cell_type, cell_style_idx) end end end
Ampersand escaped test fixed (#<I>) * Failing test to show that ampersand gets escaped * Added working example for when xlsx file uses shared strings * Fix test by getting node value instead of inner_xml
diff --git a/test/relations/HtmlJsx.js b/test/relations/HtmlJsx.js index <HASH>..<HASH> 100644 --- a/test/relations/HtmlJsx.js +++ b/test/relations/HtmlJsx.js @@ -24,4 +24,24 @@ describe('relations/HtmlJsx', function () { }) .run(done); }); + + it('should attach relations with the correct content type', function (done) { + new AssetGraph({root: __dirname + '/../../testdata/relations/HtmlJsx/'}) + .loadAssets('index.html') + .populate() + .queue(function (assetGraph) { + var html = assetGraph.findAssets({ type: 'Html' })[0]; + var target = assetGraph.findAssets({ fileName: 'external.jsx' })[0]; + var relation = new AssetGraph.HtmlJsx({ + to: target + }); + + relation.attach(html, 'after', target.incomingRelations[0]); + + expect(relation.from, 'to be', html); + expect(relation.node, 'not to be undefined'); + expect(relation.node.getAttribute('type'), 'to be', target.contentType); + }) + .run(done); + }); });
Test attaching HtmlJsx relations
diff --git a/tests/test_scatter_series.py b/tests/test_scatter_series.py index <HASH>..<HASH> 100644 --- a/tests/test_scatter_series.py +++ b/tests/test_scatter_series.py @@ -13,3 +13,10 @@ class LineSeriesCreationTests(TestCase): def test_scatter_chart_uses_chart_initialisation(self, mock): series = ScatterSeries((1, 1), (2, 4), (3, 9)) self.assertTrue(mock.called) + + + def test_scatter_series_repr(self): + series = ScatterSeries((1, 1), (2, 4), (3, 9)) + self.assertEqual(str(series), "<ScatterSeries (3 data points)>") + series = ScatterSeries((1, 1), (2, 4), (3, 9), name="line") + self.assertEqual(str(series), "<ScatterSeries 'line' (3 data points)>")
Add check on ScatterSeries repr
diff --git a/gwpy/tests/test_plotter.py b/gwpy/tests/test_plotter.py index <HASH>..<HASH> 100644 --- a/gwpy/tests/test_plotter.py +++ b/gwpy/tests/test_plotter.py @@ -1055,7 +1055,7 @@ class TestHtml(object): fig = figure() ax = fig.gca() line = ax.plot([1, 2, 3, 4, 5])[0] - data = zip(*line.get_data()) + data = list(zip(*line.get_data())) # create HTML map html = map_artist(line, 'test.png')
tests: fixed bug in testing for python3
diff --git a/test/rails_test_helper.rb b/test/rails_test_helper.rb index <HASH>..<HASH> 100644 --- a/test/rails_test_helper.rb +++ b/test/rails_test_helper.rb @@ -77,7 +77,7 @@ module Loofah end def self.gem_versions_for rails_version - mm = rails_version.canonical_segments[0,2].join(".") + mm = rails_version.segments[0,2].join(".") YAML.load_file(File.join(ARTIFACTS_DIR, "gem-versions.yml"))[mm] || {} end @@ -142,7 +142,7 @@ module Loofah VERSIONS.each do |version| safe_version = version.to_s.tr(".", "_") - short = version.canonical_segments.first(2).join(".") + short = version.segments.first(2).join(".") ruby_version = RAILS_TO_RUBY_VERSIONS[short] pipeline.write(<<~EOF) # test rails version #{version}
older versions of ruby don't have Gem::Version#canonical_segments
diff --git a/pysparkling/fileio/codec/tar.py b/pysparkling/fileio/codec/tar.py index <HASH>..<HASH> 100644 --- a/pysparkling/fileio/codec/tar.py +++ b/pysparkling/fileio/codec/tar.py @@ -32,6 +32,8 @@ class Tar(Codec): with tarfile.open(fileobj=stream, mode='r') as f: for tar_info in f.getmembers(): + if not tar_info.isfile(): + continue uncompressed.write(f.extractfile(tar_info).read()) uncompressed.seek(0) @@ -61,6 +63,8 @@ class TarGz(Codec): with tarfile.open(fileobj=stream, mode='r:gz') as f: for tar_info in f.getmembers(): + if not tar_info.isfile(): + continue uncompressed.write(f.extractfile(tar_info).read()) uncompressed.seek(0) @@ -90,6 +94,8 @@ class TarBz2(Codec): with tarfile.open(fileobj=stream, mode='r:bz2') as f: for tar_info in f.getmembers(): + if not tar_info.isfile(): + continue uncompressed.write(f.extractfile(tar_info).read()) uncompressed.seek(0)
only read file objects (not directories, ...) from tar archives
diff --git a/router/routertest/router.go b/router/routertest/router.go index <HASH>..<HASH> 100644 --- a/router/routertest/router.go +++ b/router/routertest/router.go @@ -1,4 +1,4 @@ -// Copyright 2015 tsuru authors. All rights reserved. +// Copyright 2016 tsuru authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. @@ -49,6 +49,12 @@ func (r *fakeRouter) FailForIp(ip string) { r.failuresByIp[ip] = true } +func (r *fakeRouter) RemoveFailForIp(ip string) { + r.mutex.Lock() + defer r.mutex.Unlock() + delete(r.failuresByIp, ip) +} + func (r *fakeRouter) HasBackend(name string) bool { r.mutex.Lock() defer r.mutex.Unlock()
router/routertest: allow removing forced failures from test router
diff --git a/ta4j/src/main/java/eu/verdelhan/ta4j/Tick.java b/ta4j/src/main/java/eu/verdelhan/ta4j/Tick.java index <HASH>..<HASH> 100644 --- a/ta4j/src/main/java/eu/verdelhan/ta4j/Tick.java +++ b/ta4j/src/main/java/eu/verdelhan/ta4j/Tick.java @@ -287,14 +287,14 @@ public class Tick implements Serializable { * @return a human-friendly string of the end timestamp */ public String getDateName() { - return endTime.format(DateTimeFormatter.ISO_DATE); + return endTime.format(DateTimeFormatter.ISO_DATE_TIME); } /** * @return a even more human-friendly string of the end timestamp */ public String getSimpleDateName() { - return endTime.format(DateTimeFormatter.ISO_LOCAL_DATE); + return endTime.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME); } /**
Change DateTimeFormatter.ISO_DATE to ISO_DATE_TIME - Change getDateName() DateTimeFormatter from "ISO_DATE" to "ISO_DATE_TIME" (because "date" AND "time" is needed) - Change getSimpleDateName() DateTimeFormatter from "ISO_LOCAL_DATE" to "ISO_LOCAL_DATE_TIME" (because "date" AND "time" is needed)
diff --git a/core/Access.php b/core/Access.php index <HASH>..<HASH> 100644 --- a/core/Access.php +++ b/core/Access.php @@ -727,6 +727,16 @@ class Access throw new NoAccessException($message); } + + /** + * Returns true if the current user is logged in or not. + * + * @return bool + */ + public function isUserLoggedIn() + { + return !empty($this->login); + } } /** diff --git a/core/FrontController.php b/core/FrontController.php index <HASH>..<HASH> 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -392,6 +392,7 @@ class FrontController extends Singleton $loggedIn = false; + // don't use sessionauth in cli mode // try authenticating w/ session first... $sessionAuth = $this->makeSessionAuthenticator(); if ($sessionAuth) { @@ -647,6 +648,10 @@ class FrontController extends Singleton private function makeSessionAuthenticator() { + if (Common::isPhpClimode()) { // don't use the session auth during CLI requests + return null; + } + $module = Common::getRequestVar('module', self::DEFAULT_MODULE, 'string'); $action = Common::getRequestVar('action', false);
Do not initiate auth instance if a user is already logged in in FrontController::init() (#<I>)
diff --git a/workshift/views.py b/workshift/views.py index <HASH>..<HASH> 100644 --- a/workshift/views.py +++ b/workshift/views.py @@ -86,6 +86,14 @@ def add_workshift_context(request): date__gte=date.today(), date__lte=date.today() + timedelta(days=2), ) + # TODO: Add a fudge factor of an hour to this? + happening_now = [ + shift.week_long or + not shift.start_time or + not shift.end_time or + (now > shift.start_time and now < shift.end_time) + for shift in upcoming_shifts + ] return { 'SEMESTER': SEMESTER, 'CURRENT_SEMESTER': CURRENT_SEMESTER, @@ -93,7 +101,7 @@ def add_workshift_context(request): 'days_passed': days_passed, 'total_days': total_days, 'semester_percent': semester_percent, - 'upcoming_shifts': upcoming_shifts, + 'upcoming_shifts': zip(upcoming_shifts, happening_now), } @workshift_manager_required
Zip together upcoming shifts with info about which ones are happening now
diff --git a/docs/assets/js/vendor/Blob.js b/docs/assets/js/vendor/Blob.js index <HASH>..<HASH> 100644 --- a/docs/assets/js/vendor/Blob.js +++ b/docs/assets/js/vendor/Blob.js @@ -189,9 +189,23 @@ var builder = new BlobBuilder(); if (blobParts) { for (var i = 0, len = blobParts.length; i < len; i++) { - builder.append(blobParts[i]); + if (Uint8Array && blobParts[i] instanceof Uint8Array) { + builder.append(blobParts[i].buffer); + } + else { + builder.append(blobParts[i]); + } } } - return builder.getBlob(type); + var blob = builder.getBlob(type); + if (!blob.slice && blob.webkitSlice) { + blob.slice = blob.webkitSlice; + } + return blob; + }; + + var getPrototypeOf = Object.getPrototypeOf || function(object) { + return object.__proto__; }; + view.Blob.prototype = getPrototypeOf(new view.Blob()); }(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this));
Update Blob.js to <I>-<I>-<I>. [ci skip]
diff --git a/labm8/py/humanize.py b/labm8/py/humanize.py index <HASH>..<HASH> 100644 --- a/labm8/py/humanize.py +++ b/labm8/py/humanize.py @@ -225,7 +225,7 @@ def DecimalPrefix( DecimalScale, min_scale=min_scale, max_scale=max_scale, - ) + ).rstrip() def BinaryPrefix(quantity, unit, precision=1, separator=" "): @@ -285,7 +285,8 @@ def _Prefix(quantity, unit, precision, separator, scale_callable, **args): 0, (precision - int(math.log(abs(scaled_quantity), 10)) - 1), ) - return print_pattern % (scaled_quantity, separator, scaled_unit) + string = print_pattern % (scaled_quantity, separator, scaled_unit) + return string.rstrip() # Prefixes and corresponding min_scale and max_scale for decimal formating.
Strip trailing whitespace when no quantity is provided. github.com/ChrisCummins/phd/issues/<I>
diff --git a/cdk-morphlines/cdk-morphlines-saxon/src/test/java/com/cloudera/cdk/morphline/saxon/TagsoupMorphlineTest.java b/cdk-morphlines/cdk-morphlines-saxon/src/test/java/com/cloudera/cdk/morphline/saxon/TagsoupMorphlineTest.java index <HASH>..<HASH> 100644 --- a/cdk-morphlines/cdk-morphlines-saxon/src/test/java/com/cloudera/cdk/morphline/saxon/TagsoupMorphlineTest.java +++ b/cdk-morphlines/cdk-morphlines-saxon/src/test/java/com/cloudera/cdk/morphline/saxon/TagsoupMorphlineTest.java @@ -74,7 +74,7 @@ public class TagsoupMorphlineTest extends AbstractMorphlineTest { @Test public void testConvertHTMLAndExtractLinks() throws Exception { - morphline = createMorphline("test-morphlines/convertHTMLAndExtractLinks"); + morphline = createMorphline("test-morphlines/convertHTMLandExtractLinks"); InputStream in = new FileInputStream(new File(RESOURCES_DIR + "/test-documents/helloworld.html")); Record record = new Record(); record.put("id", "123");
fix test for case-sensitive file systems
diff --git a/tests/TestCase/Routing/RouterTest.php b/tests/TestCase/Routing/RouterTest.php index <HASH>..<HASH> 100644 --- a/tests/TestCase/Routing/RouterTest.php +++ b/tests/TestCase/Routing/RouterTest.php @@ -98,6 +98,29 @@ class RouterTest extends TestCase } /** + * Test that Router used the correct url including base path for requesting current actions. + * + * @return void + */ + public function testCurrentUrlWithBasePath() + { + Router::fullBaseUrl('http://example.com'); + $request = new Request(); + $request->addParams([ + 'action' => 'view', + 'plugin' => null, + 'controller' => 'pages', + 'pass' => ['1'] + ]); + $request->base = '/cakephp'; + $request->here = '/cakephp/pages/view/1'; + Router::setRequestInfo($request); + $this->assertEquals('http://example.com/cakephp/pages/view/1', Router::url(null, true)); + $this->assertEquals('/cakephp/pages/view/1', Router::url()); + + } + + /** * testRouteDefaultParams method * * @return void
Test for current full url with a base path.
diff --git a/modules/components/Routes.js b/modules/components/Routes.js index <HASH>..<HASH> 100644 --- a/modules/components/Routes.js +++ b/modules/components/Routes.js @@ -26,8 +26,7 @@ var REF_NAME = '__activeRoute__'; var NAMED_LOCATIONS = { hash: HashLocation, history: HistoryLocation, - refresh: RefreshLocation, - disabled: RefreshLocation // TODO: Remove + refresh: RefreshLocation }; /**
[removed] location="disabled"
diff --git a/src/models/TariffProfile.php b/src/models/TariffProfile.php index <HASH>..<HASH> 100644 --- a/src/models/TariffProfile.php +++ b/src/models/TariffProfile.php @@ -44,7 +44,7 @@ class TariffProfile extends \hipanel\base\Model [['id'], 'required', 'on' => ['update', 'delete']], [['tariff_names'], 'safe'], [['seller_id', 'client_id'], 'integer'], - [['seller', 'client'], 'safe'], + [['seller', 'client', 'items'], 'safe'], [['tariffs'], 'safe'], ]; @@ -99,4 +99,14 @@ class TariffProfile extends \hipanel\base\Model { return (bool) ((string) $this->id === (string) $this->client_id); } + + /** + * Human readable title + * + * @return string + */ + public function getTitle(): string + { + return $this->isDefault() ? Yii::t('hipanel.finance.tariffprofile', 'Default') : $this->name; + } }
Added helper method TariffProfile::getTitle()
diff --git a/app/libraries/Setups/HTML5.php b/app/libraries/Setups/HTML5.php index <HASH>..<HASH> 100644 --- a/app/libraries/Setups/HTML5.php +++ b/app/libraries/Setups/HTML5.php @@ -33,7 +33,7 @@ final class HTML5 extends AbstractSetup { \add_action('after_setup_theme', [$this, 'addSupport']); \add_filter('language_attributes', [$this, 'addMicrodata']); - \add_action('wp_kses_allowed_html', [$this, 'ksesWhitelist'], 10, 2); + \add_filter('wp_kses_allowed_html', [$this, 'ksesWhitelist'], 10, 2); } /** @@ -87,7 +87,7 @@ final class HTML5 extends AbstractSetup $output .= 'ProfilePage'; } elseif ($page->is('search')) { $output .= 'SearchResultsPage'; - } elseif ($page->is('singular', 'post')) { + } elseif ($page->is('single')) { $output .= 'BlogPosting'; } else { $output .= 'WebPage';
Use `add_filter` (instead of `add_action`) for `wp_kses_allowed_html` filter
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,6 @@ from setuptools import setup, find_packages - setup( name='freezegun', version='0.0.6', @@ -11,6 +10,6 @@ setup( author_email='spulec@gmail', url='https://github.com/spulec/freezegun', packages=find_packages(), - install_requires=['python-dateutil==1.5'], + install_requires=['python-dateutil>=1.0, <2.0'], include_package_data=True, -) \ No newline at end of file +)
More relaxes requirements for dateutil
diff --git a/src/main/java/io/github/bonigarcia/wdm/WebDriverManager.java b/src/main/java/io/github/bonigarcia/wdm/WebDriverManager.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/github/bonigarcia/wdm/WebDriverManager.java +++ b/src/main/java/io/github/bonigarcia/wdm/WebDriverManager.java @@ -759,6 +759,27 @@ public abstract class WebDriverManager { } } + public synchronized void stopDockerRecording() { + webDriverList.stream().forEach(this::stopDockerRecording); + } + + public synchronized void stopDockerRecording(WebDriver driver) { + Optional<WebDriverBrowser> webDriverBrowser = findWebDriverBrowser( + driver); + if (webDriverBrowser.isPresent()) { + stopDockerRecording(webDriverBrowser.get()); + } + } + + protected synchronized void stopDockerRecording( + WebDriverBrowser driverBrowser) { + List<DockerContainer> dockerContainerList = driverBrowser + .getDockerContainerList(); + DockerContainer recorderContainer = dockerContainerList.get(0); + dockerService.stopAndRemoveContainer(recorderContainer); + dockerContainerList.remove(0); + } + protected synchronized void quit(WebDriverBrowser driverBrowser) { try { WebDriver driver = driverBrowser.getDriver();
Include API method for stop Docker recording
diff --git a/lib/turbo-sprockets/railtie.rb b/lib/turbo-sprockets/railtie.rb index <HASH>..<HASH> 100644 --- a/lib/turbo-sprockets/railtie.rb +++ b/lib/turbo-sprockets/railtie.rb @@ -21,7 +21,8 @@ module TurboSprockets if File.exist?(manifest_path) manifest = YAML.load_file(manifest_path) - config.assets.digest_files = manifest[:digest_files] || {} + # Set both digest keys for backwards compatibility + config.assets.digests = config.assets.digest_files = manifest[:digest_files] || {} config.assets.source_digests = manifest[:source_digests] || {} end end
Set both digest keys for backwards compatibility
diff --git a/lib/brainstem/concerns/controller_param_management.rb b/lib/brainstem/concerns/controller_param_management.rb index <HASH>..<HASH> 100644 --- a/lib/brainstem/concerns/controller_param_management.rb +++ b/lib/brainstem/concerns/controller_param_management.rb @@ -9,13 +9,11 @@ module Brainstem extend ActiveSupport::Concern def brainstem_model_name - self.class.brainstem_model_name.to_s.presence || - controller_name.singularize + self.class.brainstem_model_name.to_s end def brainstem_plural_model_name - self.class.brainstem_plural_model_name.to_s.presence || - brainstem_model_name.pluralize + self.class.brainstem_plural_model_name.to_s end module ClassMethods
Remove extraneous default check in instance brainstem model name lookup.
diff --git a/pycbc/events/events.py b/pycbc/events/events.py index <HASH>..<HASH> 100644 --- a/pycbc/events/events.py +++ b/pycbc/events/events.py @@ -63,7 +63,7 @@ def fc_cluster_over_window_fast(times, values, window_length): The reduced list of indices of the SNR values """ if window_length <= 0: - return times + return numpy.arange(len(times)) from scipy.weave import inline indices = numpy.zeros(len(times), dtype=int)
Fix small bug in clustering when window length = 0
diff --git a/src/mistclient/helpers.py b/src/mistclient/helpers.py index <HASH>..<HASH> 100644 --- a/src/mistclient/helpers.py +++ b/src/mistclient/helpers.py @@ -82,6 +82,8 @@ class RequestsHandler(object): def delete(self): data = {'job_id': self.job_id} if self.job_id else {} + if self.data: + data.update(json.loads(self.data)) resp = requests.delete(self.uri, json=data, headers=self.headers, timeout=self.timeout, verify=self.verify) return self.response(resp)
Allow passing a request body when calling HTTP DELETE This is required by the orchestration engine in order to denote the end of a running workflow
diff --git a/lib/moodlelib.php b/lib/moodlelib.php index <HASH>..<HASH> 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -2459,6 +2459,15 @@ function remove_course_contents($courseid, $showfeedback=true) { error('No modules are installed!'); } + // Delete course blocks + if (delete_records('block_instance', 'pagetype', PAGE_COURSE_VIEW, 'pageid', $course->id)) { + if ($showfeedback) { + notify($strdeleted .' block_instance'); + } + } else { + $result = false; + } + // Delete any user stuff if (delete_records('user_students', 'course', $course->id)) {
Err... course block instances weren't being deleted along with the course?
diff --git a/manifest.php b/manifest.php index <HASH>..<HASH> 100755 --- a/manifest.php +++ b/manifest.php @@ -27,7 +27,7 @@ return array( 'label' => 'Development Tools', 'description' => 'Developer tools that can assist you in creating new extensions, run scripts, destroy your install', 'license' => 'GPL-2.0', - 'version' => '2.6.1', + 'version' => '2.7.0', 'author' => 'Open Assessment Technologies', 'requires' => array( 'tao' => '>=2.7.0' diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php index <HASH>..<HASH> 100644 --- a/scripts/update/Updater.php +++ b/scripts/update/Updater.php @@ -38,6 +38,9 @@ class Updater extends \common_ext_ExtensionUpdater { if ($currentVersion == '2.6') { $currentVersion = '2.6.1'; } + if ($currentVersion == '2.6.1') { + $currentVersion = '2.7.0'; + } return $currentVersion; } } \ No newline at end of file
increase extension version to <I>
diff --git a/librosa/util/decorators.py b/librosa/util/decorators.py index <HASH>..<HASH> 100644 --- a/librosa/util/decorators.py +++ b/librosa/util/decorators.py @@ -5,8 +5,10 @@ import warnings from decorator import decorator +from functools import wraps import six +__all__ = ['moved', 'deprecated', 'optional_jit'] def moved(moved_from, version, version_removed): '''This is a decorator which can be used to mark functions @@ -64,6 +66,18 @@ def deprecated(version, version_removed): try: from numba.decorators import jit as optional_jit except ImportError: + # Decorator with optional arguments borrowed from + # http://stackoverflow.com/a/10288927 + def magical_decorator(decorator): + @wraps(decorator) + def inner(*args, **kw): + if len(args) == 1 and not kw and callable(args[0]): + return decorator()(args[0]) + else: + return decorator(*args, **kw) + return inner + + @magical_decorator def optional_jit(*_, **__): def __wrapper(func, *args, **kwargs): return func(*args, **kwargs)
fixed #<I>, added support for no-argument optional_jit
diff --git a/core/src/test/java/org/infinispan/distribution/MagicKey.java b/core/src/test/java/org/infinispan/distribution/MagicKey.java index <HASH>..<HASH> 100644 --- a/core/src/test/java/org/infinispan/distribution/MagicKey.java +++ b/core/src/test/java/org/infinispan/distribution/MagicKey.java @@ -114,10 +114,6 @@ public class MagicKey implements Serializable { @Override public String toString() { - return "MagicKey{" + - (name == null ? "" : "name=" + name + ", ") + - "hashcode=" + hashcode + - ", address='" + address + '\'' + - '}'; + return "MagicKey#" + name + '{' + Integer.toHexString(hashcode) + '@' + address + '}'; } } \ No newline at end of file
Shorter toString() for MagicKey
diff --git a/headnode_notifier.py b/headnode_notifier.py index <HASH>..<HASH> 100755 --- a/headnode_notifier.py +++ b/headnode_notifier.py @@ -74,11 +74,13 @@ def main(): metavar = "", action = "store", dest = "subject", + default = "", help = "Message subject") parser.add_argument("--body", metavar = "", action = "store", dest = "body", + default = "", help = "Message body") parser.add_argument("--password-file", metavar = "",
ENH@argparse:Default vals as empty strings for subject and body
diff --git a/library/src/main/java/com/liulishuo/filedownloader/event/DownloadEventPoolImpl.java b/library/src/main/java/com/liulishuo/filedownloader/event/DownloadEventPoolImpl.java index <HASH>..<HASH> 100644 --- a/library/src/main/java/com/liulishuo/filedownloader/event/DownloadEventPoolImpl.java +++ b/library/src/main/java/com/liulishuo/filedownloader/event/DownloadEventPoolImpl.java @@ -127,6 +127,8 @@ public class DownloadEventPoolImpl implements IDownloadEventPool { final Object[] lists = listeners.toArray(); for (Object o : lists) { + if (o == null) continue; // it has been removed while before listeners.toArray(). + if (((IDownloadListener) o).callback(event)) { break; }
fix(npe): fix the small probability npe crash when publish event when it has been removed on other thread Closes #<I>
diff --git a/lib/tty/prompt/timeout.rb b/lib/tty/prompt/timeout.rb index <HASH>..<HASH> 100644 --- a/lib/tty/prompt/timeout.rb +++ b/lib/tty/prompt/timeout.rb @@ -6,12 +6,10 @@ require 'timers' module TTY class Prompt class Timeout - Error = Class.new(RuntimeError) - - TIMEOUT_HANDLER = proc { |t| t.raise Error, 'timeout expired' } - + # A class responsible for measuring interval + # + # @api private def initialize(options = {}) - @timeout_handler = options.fetch(:timeout_handler) { TIMEOUT_HANDLER } @interval_handler = options.fetch(:interval_handler) { proc {} } @lock = Mutex.new @running = true
Change to remove timeout handler and error
diff --git a/lib/node.js b/lib/node.js index <HASH>..<HASH> 100644 --- a/lib/node.js +++ b/lib/node.js @@ -24,14 +24,7 @@ var appendChild = function (parent, child) { } }; -var getIsCurrent = function () { - var node = this.tree.current; - while (node) { - if (node === this) return true; - node = node.parent; - } - return false; -}; +var getIsCurrent = function () { return this.isCurrent; }; var SiteNode = module.exports = function (conf, context, parent) { this.conf = conf; @@ -45,6 +38,14 @@ var SiteNode = module.exports = function (conf, context, parent) { Object.defineProperties(SiteNode.prototype, assign({ parent: d(null), + isCurrent: d.gs(function () { + var node = this.tree.current; + while (node) { + if (node === this) return true; + node = node.parent; + } + return false; + }), // Switches between parent and this node view, or other way _switch: d(function (after) {
refactor: expose isCurrent on view node
diff --git a/ravel.py b/ravel.py index <HASH>..<HASH> 100644 --- a/ravel.py +++ b/ravel.py @@ -1145,6 +1145,16 @@ class Connection : else : removed_entry[interface] = {"at" : when} #end if + if self._props_changed != None : + props_key = (path, interface) + if self._props_changed != None and props_key in self._props_changed : + # cancel pending properties-changed notification + del self._props_changed[key] + if len(self._props_changed) == 0 : + self._props_changed = None + #end if + #end if + #end if obj_entry.remove(interface) #end for if len(obj_entry) == 0 :
Also cancel pending props-changed notifications for removed objects
diff --git a/aiogram/contrib/fsm_storage/mongo.py b/aiogram/contrib/fsm_storage/mongo.py index <HASH>..<HASH> 100644 --- a/aiogram/contrib/fsm_storage/mongo.py +++ b/aiogram/contrib/fsm_storage/mongo.py @@ -50,7 +50,7 @@ class MongoStorage(BaseStorage): self._uri = uri self._username = username self._password = password - self._kwargs = kwargs + self._kwargs = kwargs # custom client options like SSL configuration, etc. self._mongo: Optional[AsyncIOMotorClient] = None self._db: Optional[AsyncIOMotorDatabase] = None @@ -63,7 +63,7 @@ class MongoStorage(BaseStorage): if self._uri: try: - self._mongo = AsyncIOMotorClient(self._uri) + self._mongo = AsyncIOMotorClient(self._uri, **self._kwargs) except pymongo.errors.ConfigurationError as e: if "query() got an unexpected keyword argument 'lifetime'" in e.args[0]: import logging
Add support for custom kwargs for AsyncIOMotorClient in MongoStorage (#<I>)
diff --git a/Command/ImportTranslationsCommand.php b/Command/ImportTranslationsCommand.php index <HASH>..<HASH> 100644 --- a/Command/ImportTranslationsCommand.php +++ b/Command/ImportTranslationsCommand.php @@ -91,7 +91,7 @@ class ImportTranslationsCommand extends ContainerAwareCommand $classes = array( 'Symfony\Component\Validator\Validator' => '/Resources/translations', 'Symfony\Component\Form\Form' => '/Resources/translations', - 'Symfony\Component\Security\Core\Exception\AuthenticationException' => '/../Resources/translations', + 'Symfony\Component\Security\Core\Exception\AuthenticationException' => '/../../Resources/translations', ); $dirs = array();
Fixed invalid resources path leading to Exception
diff --git a/ease/feature_extractor.py b/ease/feature_extractor.py index <HASH>..<HASH> 100644 --- a/ease/feature_extractor.py +++ b/ease/feature_extractor.py @@ -74,8 +74,8 @@ class FeatureExtractor(object): def get_good_pos_ngrams(self): """ - Gets a list of gramatically correct part of speech sequences from an input file called essaycorpus.txt - Returns the list and caches the file + Gets a set of gramatically correct part of speech sequences from an input file called essaycorpus.txt + Returns the set and caches the file """ if(os.path.isfile(NGRAM_PATH)): good_pos_ngrams = pickle.load(open(NGRAM_PATH, 'rb')) @@ -92,7 +92,7 @@ class FeatureExtractor(object): 'NNP .', 'NNP . TO', 'NNP . TO NNP', '. TO', '. TO NNP', '. TO NNP NNP', 'TO NNP', 'TO NNP NNP'] - return good_pos_ngrams + return set(good_pos_ngrams) def _get_grammar_errors(self,pos,text,tokens): """
Use a set instead of a list for good ngram lookup
diff --git a/lib/compass.js b/lib/compass.js index <HASH>..<HASH> 100644 --- a/lib/compass.js +++ b/lib/compass.js @@ -71,6 +71,8 @@ module.exports = function(file, opts, callback) { // set compass setting if (opts.config_file) { options.push('-c', opts.config_file); + //Support for environment + if (opts.environment) { options.push("--environment", opts.environment); } } else { if (!opts.comments) { options.push('--no-line-comments'); } if (opts.relative) { options.push('--relative-assets'); }
Support for the environment property when using "config_file"
diff --git a/src/ol/source/imagetilesource.js b/src/ol/source/imagetilesource.js index <HASH>..<HASH> 100644 --- a/src/ol/source/imagetilesource.js +++ b/src/ol/source/imagetilesource.js @@ -109,3 +109,14 @@ ol.source.ImageTileSource.prototype.getTile = function(tileCoord) { ol.source.ImageTileSource.prototype.getTileCoordUrl = function(tileCoord) { return this.tileUrlFunction(tileCoord); }; + + +/** + * @inheritDoc + */ +ol.source.ImageTileSource.prototype.useTile = function(tileCoord) { + var key = tileCoord.toString(); + if (this.tileCache_.containsKey(key)) { + this.tileCache_.get(key); + } +};
Implement useTile for image tile sources with caches
diff --git a/apollo-gradle-plugin/src/main/java/com/apollographql/apollo/gradle/ApolloExtension.java b/apollo-gradle-plugin/src/main/java/com/apollographql/apollo/gradle/ApolloExtension.java index <HASH>..<HASH> 100644 --- a/apollo-gradle-plugin/src/main/java/com/apollographql/apollo/gradle/ApolloExtension.java +++ b/apollo-gradle-plugin/src/main/java/com/apollographql/apollo/gradle/ApolloExtension.java @@ -51,7 +51,7 @@ public class ApolloExtension { return generateModelBuilder; } - public void generateModelBuilder(boolean generateModelBuilder) { + public void setGenerateModelBuilder(boolean generateModelBuilder) { this.generateModelBuilder = generateModelBuilder; }
make generateModelBuilder read-write (#<I>)
diff --git a/src/Charcoal/Cms/Service/Loader/SectionLoader.php b/src/Charcoal/Cms/Service/Loader/SectionLoader.php index <HASH>..<HASH> 100644 --- a/src/Charcoal/Cms/Service/Loader/SectionLoader.php +++ b/src/Charcoal/Cms/Service/Loader/SectionLoader.php @@ -140,6 +140,7 @@ class SectionLoader extends AbstractLoader $q = 'SELECT * FROM `'.$proto->source()->table().'` WHERE active=1 AND ( ' . implode(' OR ', $filters) . ' ) + AND `route_options_ident` IS NULL ORDER BY creation_date ASC'; $objectRoutes = $loader->loadFromQuery($q);
Update sectionLoader to not load routes with route options ident
diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb index <HASH>..<HASH> 100644 --- a/lib/axlsx/workbook/worksheet/cell.rb +++ b/lib/axlsx/workbook/worksheet/cell.rb @@ -168,7 +168,7 @@ module Axlsx # @see Axlsx#date1904 def cast_value(v) if (@type == :time && v.is_a?(Time)) || (@type == :time && v.respond_to?(:to_time)) - v = v.to_time + v = v.respond_to?(:to_time) ? v.to_time : v epoc = Workbook.date1904 ? Time.local(1904,1,1,0,0,0,0,v.zone) : Time.local(1900,1,1,0,0,0,0,v.zone) ((v - epoc) /60.0/60.0/24.0).to_f elsif @type == :float
patch for <I> lack of to_time support on Time
diff --git a/src/JsonSchema/Constraints/Undefined.php b/src/JsonSchema/Constraints/Undefined.php index <HASH>..<HASH> 100644 --- a/src/JsonSchema/Constraints/Undefined.php +++ b/src/JsonSchema/Constraints/Undefined.php @@ -117,14 +117,15 @@ class Undefined extends Constraint // Verify required values if (is_object($value)) { - if (isset($schema->required) && is_array($schema->required) ) { + + if (!($value instanceof Undefined) && isset($schema->required) && is_array($schema->required) ) { // Draft 4 - Required is an array of strings - e.g. "required": ["foo", ...] foreach ($schema->required as $required) { if (!property_exists($value, $required)) { $this->addError($path, "the property " . $required . " is required"); } } - } else if (isset($schema->required)) { + } else if (isset($schema->required) && !is_array($schema->required)) { // Draft 3 - Required attribute - e.g. "foo": {"type": "string", "required": true} if ( $schema->required && $value instanceof Undefined) { $this->addError($path, "is missing and it is required");
dont validate draft4 required attribute when value is undefined - fixes regression introduced by <I>b2
diff --git a/command/agent/local_test.go b/command/agent/local_test.go index <HASH>..<HASH> 100644 --- a/command/agent/local_test.go +++ b/command/agent/local_test.go @@ -664,6 +664,29 @@ func TestAgent_checkTokens(t *testing.T) { } } +func TestAgent_nestedPauseResume(t *testing.T) { + l := new(localState) + if l.isPaused() != false { + t.Fatal("localState should be unPaused after init") + } + l.Pause() + if l.isPaused() != true { + t.Fatal("localState should be Paused after first call to Pause()") + } + l.Pause() + if l.isPaused() != true { + t.Fatal("localState should STILL be Paused after second call to Pause()") + } + l.Resume() + if l.isPaused() != true { + t.Fatal("localState should STILL be Paused after FIRST call to Resume()") + } + l.Resume() + if l.isPaused() != false { + t.Fatal("localState should NOT be Paused after SECOND call to Resume()") + } +} + var testRegisterRules = ` service "api" { policy = "write"
failing test showing that nested Pause()/Resume() release too early see: #<I> / <URL>
diff --git a/lib/util.js b/lib/util.js index <HASH>..<HASH> 100644 --- a/lib/util.js +++ b/lib/util.js @@ -476,7 +476,7 @@ var util = { } else if (callback && data.slice === 'function' && !isBuffer && typeof FileReader !== 'undefined') { // this might be a File/Blob - var index = 0, size = 1024 * 1024; + var index = 0, size = 1024 * 512; var reader = new FileReader(); reader.onerror = function() { callback(new Error('Failed to read data.'));
Reduce chunk size to <I>kb
diff --git a/alignak/version.py b/alignak/version.py index <HASH>..<HASH> 100644 --- a/alignak/version.py +++ b/alignak/version.py @@ -2,4 +2,4 @@ This module provide Alignak current version """ -VERSION = "1.1.0rc9" +VERSION = "2.0.0rc1"
Set version as <I> rc1
diff --git a/testsrc/org/mozilla/javascript/tests/Evaluator.java b/testsrc/org/mozilla/javascript/tests/Evaluator.java index <HASH>..<HASH> 100644 --- a/testsrc/org/mozilla/javascript/tests/Evaluator.java +++ b/testsrc/org/mozilla/javascript/tests/Evaluator.java @@ -18,10 +18,10 @@ public class Evaluator { try { Scriptable scope = cx.initStandardObjects(); if (bindings != null) { - for (String id : bindings.keySet()) { - Scriptable object = bindings.get(id); + for (Map.Entry<String, Scriptable> entry : bindings.entrySet()) { + final Scriptable object = entry.getValue(); object.setParentScope(scope); - scope.put(id, scope, object); + scope.put(entry.getKey(), scope, object); } } return cx.evaluateString(scope, source, "source", 1, null);
FindBugs: use entrySet() instead of keySet() with get()
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -20,6 +20,8 @@ setup( "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3",
Updated setup.py with more relevant classifiers
diff --git a/test/tests/helpers.js b/test/tests/helpers.js index <HASH>..<HASH> 100644 --- a/test/tests/helpers.js +++ b/test/tests/helpers.js @@ -43,6 +43,19 @@ buster.testCase('FruitMachine#helpers()', { assert.called(this.spys.destroy); }, + "Should be able to pass functions into `helpers` array if helper hasn't been defined": function() { + var spy = this.spy(); + var view = new helpers.Apple({ + helpers: [ + function(view) { + view.on('initialize', spy); + } + ] + }); + + assert.called(spy); + }, + tearDown: function() { this.view.destroy();
Added test for helpers as functions
diff --git a/datadog_checks_dev/datadog_checks/dev/tooling/commands/release/changelog.py b/datadog_checks_dev/datadog_checks/dev/tooling/commands/release/changelog.py index <HASH>..<HASH> 100644 --- a/datadog_checks_dev/datadog_checks/dev/tooling/commands/release/changelog.py +++ b/datadog_checks_dev/datadog_checks/dev/tooling/commands/release/changelog.py @@ -121,7 +121,8 @@ def changelog( thanks_note = '' if entry.from_contributor: thanks_note = f' Thanks [{entry.author}]({entry.author_url}).' - new_entry.write(f'* {entry.title}. See [#{entry.number}]({entry.url}).{thanks_note}\n') + title_period = "." if not entry.title.endswith(".") else "" + new_entry.write(f'* {entry.title}{title_period} See [#{entry.number}]({entry.url}).{thanks_note}\n') new_entry.write('\n') # read the old contents
Avoid double periods at the end of PR titles (#<I>)
diff --git a/parser/parser.go b/parser/parser.go index <HASH>..<HASH> 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -24,7 +24,9 @@ const ( ) var parserFree = sync.Pool{ - New: func() interface{} { return &parser{} }, + New: func() interface{} { + return &parser{helperBuf: new(bytes.Buffer)} + }, } // Parse reads and parses a shell program with an optional name. It @@ -76,11 +78,7 @@ type parser struct { } func (p *parser) unquotedWordBytes(w ast.Word) ([]byte, bool) { - if p.helperBuf == nil { - p.helperBuf = new(bytes.Buffer) - } else { - p.helperBuf.Reset() - } + p.helperBuf.Reset() didUnquote := false for _, wp := range w.Parts { if p.unquotedWordPart(p.helperBuf, wp) {
parser: always allocate a helper buffer Since we're reusing the parser objects, allocating right before it's actually used means unnoticeable gain in any non-trivial use case.
diff --git a/searchableselect/widgets.py b/searchableselect/widgets.py index <HASH>..<HASH> 100644 --- a/searchableselect/widgets.py +++ b/searchableselect/widgets.py @@ -35,7 +35,7 @@ class SearchableSelect(forms.CheckboxSelectMultiple): self.model = kwargs.pop('model') self.search_field = kwargs.pop('search_field') self.many = kwargs.pop('many', True) - self.limit = kwargs.pop('limit', 10) + self.limit = int(kwargs.pop('limit', 10)) super(SearchableSelect, self).__init__(*args, **kwargs)
issue #5 fix unorderable types: str() >= int() with limit
diff --git a/tests/TestCase.php b/tests/TestCase.php index <HASH>..<HASH> 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -61,6 +61,8 @@ class TestCase extends BaseTest $this->assertTrue($modifiedFileSize < $originalFileSize, "File {$modifiedFilePath} as size {$modifiedFileSize} which is not less than {$originalFileSize}. Log: {$this->log->getAllLinesAsString()}" ); + + $this->assertTrue($modifiedFileSize > 0, "File {$modifiedFilePath} had a filesize of zero. Something must have gone wrong..."); } public function assertOptimizersUsed($optimizerClasses)
add non zero filesize test, just to be sure
diff --git a/src/Kris/LaravelFormBuilder/Form.php b/src/Kris/LaravelFormBuilder/Form.php index <HASH>..<HASH> 100644 --- a/src/Kris/LaravelFormBuilder/Form.php +++ b/src/Kris/LaravelFormBuilder/Form.php @@ -299,10 +299,9 @@ class Form { if ($this->has($name)) { unset($this->fields[$name]); - return $this; } - $this->fieldDoesNotExist($name); + return $this; } /** diff --git a/tests/FormTest.php b/tests/FormTest.php index <HASH>..<HASH> 100644 --- a/tests/FormTest.php +++ b/tests/FormTest.php @@ -287,17 +287,6 @@ class FormTest extends FormBuilderTestCase * @test * @expectedException \InvalidArgumentException */ - public function it_throws_exception_when_removing_nonexisting_field() - { - $this->plainForm->add('name', 'text'); - - $this->plainForm->remove('nonexisting'); - } - - /** - * @test - * @expectedException \InvalidArgumentException - */ public function it_throws_exception_when_rendering_until_nonexisting_field() { $this->plainForm
Avoid exceptions on non-existing fields as discussed in #<I> (also removed this test)
diff --git a/Socks/Client.php b/Socks/Client.php index <HASH>..<HASH> 100644 --- a/Socks/Client.php +++ b/Socks/Client.php @@ -116,7 +116,8 @@ class Client implements ConnectionManagerInterface private function resolve($host) { - if ($this->protocolVersion !== '4' && (!$this->resolveLocal || false !== filter_var($host, FILTER_VALIDATE_IP))) { + // return if it's already an IP or we want to resolve remotely (socks 4 only supports resolving locally) + if (false !== filter_var($host, FILTER_VALIDATE_IP) || ($this->protocolVersion !== '4' && !$this->resolveLocal)) { return When::resolve($host); }
Fix logic for resolving target hostname locally/remotely
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -35,6 +35,7 @@ setup( 'isodate>=0.5.0', 'xmlsec>=0.2.1' ], + dependency_links=['http://github.com/bgaifullin/python-xmlsec/tarball/master'], extras_require={ 'test': ( 'coverage==3.7.1',
added dependency link to xmlsec
diff --git a/src/Expander.php b/src/Expander.php index <HASH>..<HASH> 100644 --- a/src/Expander.php +++ b/src/Expander.php @@ -277,9 +277,12 @@ class Expander implements LoggerAwareInterface if (str_starts_with($property_name, "env.") && !$data->has($property_name)) { $env_key = substr($property_name, 4); - if (isset($_SERVER[$env_key])) { - $data->set($property_name, $_SERVER[$env_key]); - } + if (isset($_SERVER[$env_key])) { + $data->set($property_name, $_SERVER[$env_key]); + } + elseif (getenv($env_key)) { + $data->set($property_name, getenv($env_key)); + } } if (!$data->has($property_name)) {
Use both $_SERVER and getenv() when checking for env vars.
diff --git a/vendor/assets/javascripts/s3_cors_fileupload/jquery.fileupload-ui.js b/vendor/assets/javascripts/s3_cors_fileupload/jquery.fileupload-ui.js index <HASH>..<HASH> 100755 --- a/vendor/assets/javascripts/s3_cors_fileupload/jquery.fileupload-ui.js +++ b/vendor/assets/javascripts/s3_cors_fileupload/jquery.fileupload-ui.js @@ -531,6 +531,7 @@ }, _deleteHandler: function (e) { + if (confirm('Are you sure?')) { e.preventDefault(); var button = $(e.currentTarget); this._trigger('destroy', e, { @@ -539,6 +540,7 @@ type: button.attr('data-type') || 'DELETE', dataType: this.options.dataType }); + } }, _forceReflow: function (node) {
Making the delete functionality give a javascript confirm dialog prior to executing.
diff --git a/salt/version.py b/salt/version.py index <HASH>..<HASH> 100644 --- a/salt/version.py +++ b/salt/version.py @@ -57,8 +57,8 @@ class SaltStackVersion(object): 'Hydrogen': (sys.maxint - 108, 0, 0, 0), 'Helium': (sys.maxint - 107, 0, 0, 0), 'Lithium': (sys.maxint - 106, 0, 0, 0), - #'Beryllium' : (sys.maxint - 105, 0, 0, 0), - #'Boron' : (sys.maxint - 104, 0, 0, 0), + 'Beryllium' : (sys.maxint - 105, 0, 0, 0), + 'Boron' : (sys.maxint - 104, 0, 0, 0), #'Carbon' : (sys.maxint - 103, 0, 0, 0), #'Nitrogen' : (sys.maxint - 102, 0, 0, 0), #'Oxygen' : (sys.maxint - 101, 0, 0, 0),
We will start deprecating until Boron.
diff --git a/packages/generators/yeoman-create-component/generators/component/index.js b/packages/generators/yeoman-create-component/generators/component/index.js index <HASH>..<HASH> 100644 --- a/packages/generators/yeoman-create-component/generators/component/index.js +++ b/packages/generators/yeoman-create-component/generators/component/index.js @@ -74,6 +74,7 @@ module.exports = class extends Generator { this.gitInfo.email = 'test@example.org'; this.gitInfo.github = ''; this.boltVersion = '0.0.0'; + this.boltCoreVersion = '0.0.0'; } }
DS-<I>: update generator test to include test boltCoreVersion number
diff --git a/net/httputil/httputil.go b/net/httputil/httputil.go index <HASH>..<HASH> 100644 --- a/net/httputil/httputil.go +++ b/net/httputil/httputil.go @@ -7,7 +7,7 @@ import ( "os" ) -func GetStore(url string, filepath string, perm os.FileMode) error { +func GetWriteFile(url string, filepath string, perm os.FileMode) error { resp, err := http.Get(url) if err != nil { return err
rename method to httputil.GetWriteFile()
diff --git a/suspect/basis/__init__.py b/suspect/basis/__init__.py index <HASH>..<HASH> 100644 --- a/suspect/basis/__init__.py +++ b/suspect/basis/__init__.py @@ -2,7 +2,7 @@ import numpy def gaussian(time_axis, frequency, phase, fwhm): - oscillatory_term = numpy.exp(2j * numpy.pi * (frequency * time_axis + phase)) + oscillatory_term = numpy.exp(2j * numpy.pi * (frequency * time_axis) + 1j * phase) damping = numpy.exp(-time_axis ** 2 / 4 * numpy.pi ** 2 / numpy.log(2) * fwhm ** 2) fid = oscillatory_term * damping fid[0] /= 2.0
adjust Gaussian generation to take phase in radians
diff --git a/lib/starscope/langs/javascript.rb b/lib/starscope/langs/javascript.rb index <HASH>..<HASH> 100644 --- a/lib/starscope/langs/javascript.rb +++ b/lib/starscope/langs/javascript.rb @@ -12,12 +12,15 @@ module Starscope::Lang def self.extract(path, contents, &block) transform = Babel::Transpiler.transform(contents, - 'optional' => ['es7.functionBind', 'es7.decorators'], + 'stage' => 0, + 'blacklist' => ['validation.react'], 'externalHelpers' => true, 'compact' => false, 'sourceMaps' => true) map = SourceMap::Map.from_hash(transform['map']) ast = RKelly::Parser.new.parse(transform['code']) + return unless ast + lines = contents.lines.to_a found = {}
Adjust babel js options again also skip entirely empty empty js files