diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/flask_cors/extension.py b/flask_cors/extension.py index <HASH>..<HASH> 100644 --- a/flask_cors/extension.py +++ b/flask_cors/extension.py @@ -61,7 +61,11 @@ class CORS(object): :param origins: The origin, or list of origins to allow requests from. The origin(s) may be regular expressions, case-sensitive strings, - or else an asterisk + or else an asterisk. + + :note: origins must include the schema and the port (if not port 80), + e.g., + `CORS(app, origins=["http://localhost:8000", "https://example.com"])`. Default : '*' :type origins: list, string or regex
Include examples to specify that schema and port must be included in origins documentation. (#<I>)
diff --git a/lib/rubocop/cop/style/regexp_literal.rb b/lib/rubocop/cop/style/regexp_literal.rb index <HASH>..<HASH> 100644 --- a/lib/rubocop/cop/style/regexp_literal.rb +++ b/lib/rubocop/cop/style/regexp_literal.rb @@ -170,27 +170,31 @@ module RuboCop end def correct_inner_slashes(node, corrector) - search_indices( - node_body(node), - inner_slash_before_correction(node) - ).each do |index| + regexp_begin = node.loc.begin.end_pos + + inner_slash_indices(node).each do |index| + start = regexp_begin + index + corrector.replace( range_between( - node.loc.begin.end_pos + index, - node.loc.begin.end_pos + index + - inner_slash_before_correction(node).length + start, + start + inner_slash_before_correction(node).length ), inner_slash_after_correction(node) ) end end - def search_indices(text, pattern) - index = -1 + def inner_slash_indices(node) + text = node_body(node) + pattern = inner_slash_before_correction(node) + index = -1 indices = [] + while (index = text.index(pattern, index + 1)) indices << index end + indices end
Refactor complex method in Style/RegexpLiteral cop This cop had a relatively complex (ABC = <I>) method `#correct_inner_slashes`. This change attempts to simplify it by making the method `#search_indices` less general, and having it take on some of the responsibility that was previously in `#correct_inner_slashes`.
diff --git a/superset/views/core.py b/superset/views/core.py index <HASH>..<HASH> 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -2793,7 +2793,7 @@ class Superset(BaseSupersetView): # pylint: disable=too-many-public-methods .scalar() ) if welcome_dashboard_id: - return self.dashboard(str(welcome_dashboard_id)) + return self.dashboard(dashboard_id_or_slug=str(welcome_dashboard_id)) payload = { "user": bootstrap_user_data(g.user),
Fixed KeyError by making kwarg explicit (#<I>)
diff --git a/indra/assemblers/pysb/assembler.py b/indra/assemblers/pysb/assembler.py index <HASH>..<HASH> 100644 --- a/indra/assemblers/pysb/assembler.py +++ b/indra/assemblers/pysb/assembler.py @@ -2101,7 +2101,7 @@ def conversion_assemble_one_step(stmt, model, agent_set, parameters): sites_dict[site] = obj_to_monomer.site_states[site][0] else: sites_dict[site] = None - obj_to_pattern = obj_to_monomer(**sites_dict) + obj_to_pattern = ComplexPattern([obj_to_monomer(**sites_dict)], None) obj_to_patterns.append(obj_to_pattern) obj_to_pattern = ReactionPattern(obj_to_patterns)
Change object elements to ComplexPattern
diff --git a/serviced/stats.go b/serviced/stats.go index <HASH>..<HASH> 100644 --- a/serviced/stats.go +++ b/serviced/stats.go @@ -25,9 +25,9 @@ import ( ) const ( - BLKIODIR = "/sys/fs/cgroup/blkio/lxc" - CPUDIR = "/sys/fs/cgroup/cpuacct/lxc" - MEMDIR = "/sys/fs/cgroup/memory/lxc" + BLKIODIR = "/sys/fs/cgroup/blkio" + CPUDIR = "/sys/fs/cgroup/cpuacct" + MEMDIR = "/sys/fs/cgroup/memory" ) // StatsReporter is a mechanism for gathering container statistics and sending
don't use lxc specific stats for cgroups
diff --git a/wikitextparser/spans.py b/wikitextparser/spans.py index <HASH>..<HASH> 100644 --- a/wikitextparser/spans.py +++ b/wikitextparser/spans.py @@ -121,7 +121,6 @@ def parse_to_spans(string): 'wikilinks': wikilink_spans, 'comments': comment_spans, 'exttags': extension_tag_spans, - 'tables': tables } """ comment_spans = [] @@ -202,7 +201,7 @@ def indexed_parse_to_spans( """Basically the same as `parse_to_spans`, but with some arguments. Accept an index and list of spans as argument. - Designed to deal with wikitexts within extension tags. + The goal is to deal with wikitexts within extension tags. """ # Currently, does not work with nested <!-- comments --> or tag extensions. # The title in WikiLinks may contain braces that interfere with
remove 'tables': tables from docstring. Currently I've decided to implemented it in a seprate module.
diff --git a/src/voeventparse/voevent.py b/src/voeventparse/voevent.py index <HASH>..<HASH> 100644 --- a/src/voeventparse/voevent.py +++ b/src/voeventparse/voevent.py @@ -82,7 +82,7 @@ def loads(s, check_version=True): Returns: :py:class:`Voevent`: Root-node of the etree. Raises: - exceptions.ValueError: If passed a VOEvent of wrong schema version + ValueError: If passed a VOEvent of wrong schema version (i.e. schema 1.1) """
DOCS: Fix docs-build for Sphinx <I>. It seems exceptions must no longer have the `exceptions.` prefix for Intersphinx to handle them correctly.
diff --git a/lib/sensor/driver/gps/index.js b/lib/sensor/driver/gps/index.js index <HASH>..<HASH> 100644 --- a/lib/sensor/driver/gps/index.js +++ b/lib/sensor/driver/gps/index.js @@ -36,7 +36,7 @@ function Gps(sensorInfo, options) { if (addr) { port = new serialport.SerialPort('/dev/ttyO' + addr, { - baudrate: options.baudRate || 4800, + baudrate: options.baudRate || 9600, parser: serialport.parsers.readline('\r\n') }); port.on('data', function(line) {
[driver/gps] change default baudRate from <I> to <I>
diff --git a/android/src/main/java/com/imagepicker/ImagePickerModule.java b/android/src/main/java/com/imagepicker/ImagePickerModule.java index <HASH>..<HASH> 100644 --- a/android/src/main/java/com/imagepicker/ImagePickerModule.java +++ b/android/src/main/java/com/imagepicker/ImagePickerModule.java @@ -307,7 +307,7 @@ public class ImagePickerModule extends ReactContextBaseJavaModule // user cancel if (resultCode != Activity.RESULT_OK) { - responseHelper.invokeResponse(callback); + responseHelper.invokeCancel(callback); callback = null; return; }
Android: fix cancellation handling (#<I>) - This was broken by #<I>. - Currently, the response object is empty, lacking the `didCancel` flag.
diff --git a/ocsp/responder.go b/ocsp/responder.go index <HASH>..<HASH> 100644 --- a/ocsp/responder.go +++ b/ocsp/responder.go @@ -197,8 +197,8 @@ func (rs Responder) ServeHTTP(response http.ResponseWriter, request *http.Reques expiresIn := int(parsedResponse.NextUpdate.Sub(now) / time.Second) maxAge = &expiresIn } else { - zero := 0 - maxAge = &zero + zero := 0 // XXX: we want max-age=0 but since this is technically an authorized OCSP response + maxAge = &zero // (despite being stale) and 5019 forbids attaching no-cache we get a little tricky } response.WriteHeader(http.StatusOK) response.Write(ocspResponse)
Add comment about max-age for stale response
diff --git a/src/org/opencms/jsp/CmsJspNavBuilder.java b/src/org/opencms/jsp/CmsJspNavBuilder.java index <HASH>..<HASH> 100644 --- a/src/org/opencms/jsp/CmsJspNavBuilder.java +++ b/src/org/opencms/jsp/CmsJspNavBuilder.java @@ -592,7 +592,7 @@ public class CmsJspNavBuilder { list.add(ne); // check if navigation entry is a folder and below the max level -> if so, get the navigation from this folder as well if (ne.isFolderLink() && (noLimit || (ne.getNavTreeLevel() < endLevel))) { - List<CmsJspNavElement> subnav = getSiteNavigation(ne.getResourceName(), endLevel); + List<CmsJspNavElement> subnav = getSiteNavigation(m_cms.getSitePath(ne.getResource()), endLevel); // copy the result of the subfolder to the result list list.addAll(subnav); }
Fixed problem with navigation levels breaking the site navigation.
diff --git a/src/api/Search.js b/src/api/Search.js index <HASH>..<HASH> 100644 --- a/src/api/Search.js +++ b/src/api/Search.js @@ -1,7 +1,6 @@ // @flow import SimpleQueryRequest from './SimpleQueryRequest'; import QueryResponse from './QueryResponse'; -import FieldNames from './FieldNames'; import AuthUtils from '../util/AuthUtils'; import FetchUtils from '../util/FetchUtils'; import ObjectUtils from '../util/ObjectUtils';
Issue <I>: Remove unused import
diff --git a/docs/master/sidebar.js b/docs/master/sidebar.js index <HASH>..<HASH> 100644 --- a/docs/master/sidebar.js +++ b/docs/master/sidebar.js @@ -104,7 +104,6 @@ module.exports = [{ 'guides/validation', 'guides/relationships', 'guides/file-uploads', - 'guides/custom-directives', 'guides/error-handling', 'guides/plugin-development' ]
Docs: remove deleted guide from sidebar
diff --git a/spec/rester/client_spec.rb b/spec/rester/client_spec.rb index <HASH>..<HASH> 100644 --- a/spec/rester/client_spec.rb +++ b/spec/rester/client_spec.rb @@ -261,8 +261,7 @@ module Rester end it 'should return the context back to nil' do - client.with_context(context) do - end + client.with_context(context) {} expect(client.adapter.context).to eq nil end end # with StubAdapter @@ -272,8 +271,7 @@ module Rester it 'should raise error' do expect { - client.with_context(context) do - end + client.with_context(context) {} }.to raise_error Errors::MethodError, 'Can only use "with_context" with a StubAdapter' end end # with non-StubAdapter
[#<I>] Shorten block
diff --git a/baselines/deepq/experiments/run_atari.py b/baselines/deepq/experiments/run_atari.py index <HASH>..<HASH> 100644 --- a/baselines/deepq/experiments/run_atari.py +++ b/baselines/deepq/experiments/run_atari.py @@ -23,17 +23,15 @@ def main(): env = make_atari(args.env) env = bench.Monitor(env, logger.get_dir()) env = deepq.wrap_atari_dqn(env) - model = deepq.models.cnn_to_mlp( - convs=[(32, 8, 4), (64, 4, 2), (64, 3, 1)], - hiddens=[256], - dueling=bool(args.dueling), - ) deepq.learn( env, - q_func=model, + "conv_only", + convs=[(32, 8, 4), (64, 4, 2), (64, 3, 1)], + hiddens=[256], + dueling=bool(args.dueling), lr=1e-4, - max_timesteps=args.num_timesteps, + total_timesteps=args.num_timesteps, buffer_size=10000, exploration_fraction=0.1, exploration_final_eps=0.01,
Fix argument error in deepq (#<I>) * Fix argment error in deepq * Fix argment error in deepq
diff --git a/libraries/mako/ArrayTo.php b/libraries/mako/ArrayTo.php index <HASH>..<HASH> 100644 --- a/libraries/mako/ArrayTo.php +++ b/libraries/mako/ArrayTo.php @@ -51,7 +51,7 @@ class ArrayTo { $data = json_encode($data); - if(isset($_GET['jsoncallback'])) + if(!empty($_GET['jsoncallback'])) { $data = $_GET['jsoncallback'] . '(' . $data . ')'; }
Replaced isset with !empty
diff --git a/src/js/plugin/dendrogram.js b/src/js/plugin/dendrogram.js index <HASH>..<HASH> 100644 --- a/src/js/plugin/dendrogram.js +++ b/src/js/plugin/dendrogram.js @@ -39,7 +39,7 @@ selectedNodeOpacity: null, collapsedNodeColor: null, collapsedNodeOpacity: null, - initialize: null + newNodes: null }, _missing: { @@ -453,8 +453,8 @@ d.y0 = d.y; }); - if (this.options.initialize) { - this.options.initialize(nodeEnter, node, nodeExit); + if (this.options.newNodes) { + nodeEnter.each(this.options.newNodes); } },
Renamed "initialize" to "newNodes"; eliminated access to update and exit selections.
diff --git a/src/from_dom.js b/src/from_dom.js index <HASH>..<HASH> 100644 --- a/src/from_dom.js +++ b/src/from_dom.js @@ -425,7 +425,7 @@ class ParseContext { // none is found, the element's content nodes are added directly. addElement(dom) { let name = dom.nodeName.toLowerCase() - if (listTags.hasOwnProperty(name) && this.normalizeLists) normalizeList(dom) + if (listTags.hasOwnProperty(name) && this.parser.normalizeLists) normalizeList(dom) let rule = (this.options.ruleFromNode && this.options.ruleFromNode(dom)) || this.parser.matchTag(dom, this) if (rule ? rule.ignore : ignoreTags.hasOwnProperty(name)) { this.findInside(dom)
Fix list normalization in DOM parser FIX: Fix a bug that prevented non-canonical list structure from being normalized.
diff --git a/proctor-webapp-library/src/main/java/com/indeed/proctor/webapp/jobs/EditAndPromoteJob.java b/proctor-webapp-library/src/main/java/com/indeed/proctor/webapp/jobs/EditAndPromoteJob.java index <HASH>..<HASH> 100644 --- a/proctor-webapp-library/src/main/java/com/indeed/proctor/webapp/jobs/EditAndPromoteJob.java +++ b/proctor-webapp-library/src/main/java/com/indeed/proctor/webapp/jobs/EditAndPromoteJob.java @@ -475,6 +475,10 @@ public class EditAndPromoteJob extends AbstractJob { } private static boolean isInactiveBucket(final TestBucket bucket) { + // Proctor does not define inactive buckets, + // so we only assume a bucket is the inactive group + // if it has value value -1 and one of the 2 typical names "inactive" or "disabled". + // See further discussion in the ticket. https://bugs.indeed.com/browse/PROW-518 return bucket.getValue() == -1 && ("inactive".equalsIgnoreCase(bucket.getName()) || "disabled".equalsIgnoreCase(bucket.getName())); }
PROW-<I>: Add comments about identifying inactive test
diff --git a/spec/integration/enqueuing_jobs_spec.rb b/spec/integration/enqueuing_jobs_spec.rb index <HASH>..<HASH> 100644 --- a/spec/integration/enqueuing_jobs_spec.rb +++ b/spec/integration/enqueuing_jobs_spec.rb @@ -9,7 +9,7 @@ describe 'enqueuing jobs to Redis' do serialized_job = redis.lpop(TEST_QUEUE) job_from_redis = Workerholic::JobSerializer.deserialize(serialized_job) - expected_job = Workerholic::JobWrapper.new(klass: SimpleJobTest, arguments: ['test job']) + expected_job = Workerholic::JobWrapper.new(klass: SimpleJobTest, arguments: ['test job'], wrapper: SimpleJobTest) expected_job.statistics.enqueued_at = job_from_redis.statistics.enqueued_at expect(job_from_redis.to_hash).to eq(expected_job.to_hash) @@ -22,7 +22,8 @@ describe 'enqueuing jobs to Redis' do expected_job = Workerholic::JobWrapper.new( klass: ComplexJobTest, - arguments: ['test job', { a: 1, b: 2 }, [1, 2, 3]] + arguments: ['test job', { a: 1, b: 2 }, [1, 2, 3]], + wrapper: ComplexJobTest ) expected_job.statistics.enqueued_at = job_from_redis.statistics.enqueued_at
update enqueuing integration spec to include wrapper class
diff --git a/packages/@vue/cli-service/lib/commands/serve.js b/packages/@vue/cli-service/lib/commands/serve.js index <HASH>..<HASH> 100644 --- a/packages/@vue/cli-service/lib/commands/serve.js +++ b/packages/@vue/cli-service/lib/commands/serve.js @@ -76,8 +76,8 @@ module.exports = (api, options) => { `webpack-dev-server/client/?${urls.localUrlForBrowser}`, // hmr client projectDevServerOptions.hotOnly - ? 'webpack/hot/dev-server' - : 'webpack/hot/only-dev-server' + ? 'webpack/hot/only-dev-server' + : 'webpack/hot/dev-server' // TODO custom overlay client // `@vue/cli-overlay/dist/client` ])
fix hot/hotOnly client check
diff --git a/lib/rack/tracker/google_analytics/google_analytics.rb b/lib/rack/tracker/google_analytics/google_analytics.rb index <HASH>..<HASH> 100644 --- a/lib/rack/tracker/google_analytics/google_analytics.rb +++ b/lib/rack/tracker/google_analytics/google_analytics.rb @@ -1,5 +1,12 @@ require 'ostruct' +# Backport of 2.0.0 stdlib ostruct#to_h +class OpenStruct + def to_h + @table.dup + end unless method_defined? :to_h +end + class Rack::Tracker::GoogleAnalytics < Rack::Tracker::Handler class Event < OpenStruct def write
test backport of ostruct#to_h on travis
diff --git a/assets/js/ajax-section.js b/assets/js/ajax-section.js index <HASH>..<HASH> 100644 --- a/assets/js/ajax-section.js +++ b/assets/js/ajax-section.js @@ -122,7 +122,7 @@ athens.ajax_section = (function () { var targetDiv, targetUrl; targetDiv = $("#" + id); - if (sectionRegistry.hasOwnProperty(id)) { + if (sectionRegistry.hasOwnProperty(id) && !targetDiv.data("request-uri")) { targetUrl = sectionRegistry[id]; } else { targetUrl = targetDiv.data("request-uri");
Don't store section url.
diff --git a/tests/commands/test_usage.py b/tests/commands/test_usage.py index <HASH>..<HASH> 100644 --- a/tests/commands/test_usage.py +++ b/tests/commands/test_usage.py @@ -102,7 +102,7 @@ def test_command_config_file(): test_font = os.path.join("data", "test", "nunito", "Nunito-Regular.ttf") result = subprocess.run(["fontbakery", "check-googlefonts", "--config", config.name, - test_font], capture_output=True) + test_font], stdout=subprocess.PIPE) stdout = result.stdout.decode() assert "running 1 individual check" in stdout os.unlink(config.name) @@ -122,7 +122,7 @@ OK = 123 "-C", "--config", config.name, test_profile, - test_font], capture_output=True) + test_font], stdout=subprocess.PIPE) stdout = result.stdout.decode() assert "FAIL: 0" in stdout os.unlink(config.name)
Avoid <I>ism.
diff --git a/src/widgets/views/DocumentByMonthButton.php b/src/widgets/views/DocumentByMonthButton.php index <HASH>..<HASH> 100644 --- a/src/widgets/views/DocumentByMonthButton.php +++ b/src/widgets/views/DocumentByMonthButton.php @@ -1,7 +1,7 @@ <?php use hipanel\widgets\ModalButton; -use kartik\date\DatePicker; +use hipanel\widgets\DateTimePicker; use yii\helpers\Html; /** @var string $prepend */ @@ -38,14 +38,14 @@ use yii\helpers\Html; <?= $prepend ?> -<?= $modalButton->form->field($model, 'month')->widget(DatePicker::class, [ +<?= $modalButton->form->field($model, 'month')->widget(DateTimePicker::class, [ 'options' => [ 'id' => 'purse-month-' . uniqid(), ], - 'pluginOptions' => [ + 'clientOptions' => [ 'format' => 'yyyy-mm', - 'viewMode' => 'months', - 'minViewMode' => 'months', + 'minView' => 3, + 'startView' => 'year', 'autoclose' => true, 'endDate' => $dt->modify('next month')->format('Y-m'), ],
replaced DatePicker class with DateTimePicker (#<I>) * removed DatePicker class * fixed datetime widget clicking bug
diff --git a/lib/code_climate_check/compare_gpa.rb b/lib/code_climate_check/compare_gpa.rb index <HASH>..<HASH> 100644 --- a/lib/code_climate_check/compare_gpa.rb +++ b/lib/code_climate_check/compare_gpa.rb @@ -2,7 +2,6 @@ require 'code_climate_check/get_gpa' module CodeClimateCheck class CompareGpa - def initialize(token, repo) @token, @repo = token, repo end
Remove extra empty line in compare_gpa
diff --git a/lib/puppet/parser/resource.rb b/lib/puppet/parser/resource.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/parser/resource.rb +++ b/lib/puppet/parser/resource.rb @@ -5,8 +5,6 @@ require 'puppet/resource' # parent is that this class has rules on who can set # parameters class Puppet::Parser::Resource < Puppet::Resource - extend Forwardable - require 'puppet/parser/resource/param' require 'puppet/util/tagging' require 'puppet/parser/yaml_trimmer' @@ -56,7 +54,9 @@ class Puppet::Parser::Resource < Puppet::Resource end end - def_delegator :scope, :environment + def environment + scope.environment + end # Process the stage metaparameter for a class. A containment edge # is drawn from the class to the stage. The stage for containment @@ -228,7 +228,9 @@ class Puppet::Parser::Resource < Puppet::Resource end # Convert this resource to a RAL resource. - def_delegator :to_resource, :to_ral + def to_ral + to_resource.to_ral + end private
(#<I>) Remove 2 def_delegator's in favor of explicit method invocations.
diff --git a/dp_tornado/helper/numeric/__init__.py b/dp_tornado/helper/numeric/__init__.py index <HASH>..<HASH> 100644 --- a/dp_tornado/helper/numeric/__init__.py +++ b/dp_tornado/helper/numeric/__init__.py @@ -25,7 +25,22 @@ class NumericHelper(dpHelper): return re.sub(r'\D+', '', string) def number_format(self, value, tsep=',', dsep='.'): - value = self.extract_numbers(value) + if self.helper.misc.type.check.string(value): + value = value.replace(',', '') + + if '.' in value: + value_cast = self.helper.numeric.cast.float(value) + else: + value_cast = self.helper.numeric.cast.long(value) + + if value_cast is not False: + value = value_cast + else: + value = self.extract_numbers(value) + elif self.helper.misc.type.check.numeric(value): + value = value + else: + raise Exception('Invalid value.') if not value: return '0'
enhanced type casting for number_format.
diff --git a/mailmerge/sendmail_client.py b/mailmerge/sendmail_client.py index <HASH>..<HASH> 100644 --- a/mailmerge/sendmail_client.py +++ b/mailmerge/sendmail_client.py @@ -70,12 +70,7 @@ class SendmailClient: ) def sendmail(self, sender, recipients, message): - """Send email message. - - Note that we can't use the elegant smtp.send_message(message)" because - Python 2 doesn't support it. Both Python 2 and Python 3 support - smtp.sendmail(sender, recipients, flattened_message_str). - """ + """Send email message.""" if self.dry_run: return
Kill comment. We can't use send_message() because of BCC privacy
diff --git a/motion/ruby_motion_query/app.rb b/motion/ruby_motion_query/app.rb index <HASH>..<HASH> 100644 --- a/motion/ruby_motion_query/app.rb +++ b/motion/ruby_motion_query/app.rb @@ -32,6 +32,19 @@ module RubyMotionQuery UIApplication.sharedApplication.delegate end + # @return [UIApplication] + def get + UIApplication.sharedApplication + end + + # Returns boolean of success of hiding + # @return [Boolean] + def hide_keyboard + self.get.sendAction(:resignFirstResponder, to:nil, from:nil, forEvent:nil) + end + alias :resign_responders :hide_keyboard + alias :end_editing :hide_keyboard + # @return [Symbol] Environment the app is running it def environment @_environment ||= RUBYMOTION_ENV.to_sym
code to hide keyboard from rmq.app added
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -7,4 +7,7 @@ begin rescue LoadError end +# https://github.com/geemus/excon/issues/142#issuecomment-8531521 +Excon.defaults[:nonblock] = false if RUBY_PLATFORM == 'java' + require 'peddler'
Use blocking connect if running on JRuby
diff --git a/safe/impact_functions/loader.py b/safe/impact_functions/loader.py index <HASH>..<HASH> 100644 --- a/safe/impact_functions/loader.py +++ b/safe/impact_functions/loader.py @@ -67,6 +67,8 @@ from safe.impact_functions.volcanic.volcano_point_population\ # Volcanic Ash from safe.impact_functions.ash.ash_raster_landcover.impact_function import \ AshRasterLandcoverFunction +from safe.impact_functions.ash.ash_raster_population.impact_function import \ + AshRasterPopulationFunction def register_impact_functions(): @@ -116,3 +118,5 @@ def register_impact_functions(): # Volcanic Ash IF's # Added in 3.4 impact_function_registry.register(AshRasterLandcoverFunction) + # Added in 3.5 + impact_function_registry.register(AshRasterPopulationFunction)
Add ash raster IF to loader.
diff --git a/azurerm/resource_arm_dns_cname_record.go b/azurerm/resource_arm_dns_cname_record.go index <HASH>..<HASH> 100644 --- a/azurerm/resource_arm_dns_cname_record.go +++ b/azurerm/resource_arm_dns_cname_record.go @@ -47,9 +47,8 @@ func resourceArmDnsCNameRecord() *schema.Resource { }, "records": { - Type: schema.TypeSet, + Type: schema.TypeString, Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, Removed: "Use `record` instead. This attribute will be removed in a future version", },
r/cname_record: `records` is a string, albeit deprecated
diff --git a/src/tests/test_definitions.py b/src/tests/test_definitions.py index <HASH>..<HASH> 100644 --- a/src/tests/test_definitions.py +++ b/src/tests/test_definitions.py @@ -223,7 +223,7 @@ def test_import_parser(): source_future_import_invalid7, source_future_import_invalid8, ), 1): - module = parse(StringIO(source_ucl), 'file_invalid{}.py'.format(i)) + module = parse(StringIO(source_ucli), 'file_invalid{}.py'.format(i)) assert Module('file_invalid{}.py'.format(i), _, 1, _, _, None, _, _,
Fix parser test case for invalid source Commit e<I> introduced some tests that intend to iterate over strings that contain definitions of invalid source code and then assert that the parser does something sensible with these sources. However, there was a typo in e<I> causing the tests to not execute as expected: the invalid sources are iterated in the `source_ucli` variable. However, the parsing is done against the `source_ucl` variable which contains a known parsable source string!
diff --git a/src/python/dxpy/scripts/dx_build_app.py b/src/python/dxpy/scripts/dx_build_app.py index <HASH>..<HASH> 100755 --- a/src/python/dxpy/scripts/dx_build_app.py +++ b/src/python/dxpy/scripts/dx_build_app.py @@ -242,7 +242,9 @@ def _lint(dxapp_json_filename, mode): readme_filename = _find_readme(os.path.dirname(dxapp_json_filename)) if 'description' in app_spec: if readme_filename: - logger.warn('"description" field shadows file ' + readme_filename) + raise dxpy.app_builder.AppBuilderException('Description was provided both in Readme.md ' + 'and in the "description" field of {file}. Please consolidate content in Readme.md ' + 'and remove the "description" field.'.format(file=dxapp_json_filename)) if not app_spec['description'].strip().endswith('.'): logger.warn('"description" field should be written in complete sentences and end with a period') else:
PTFM-<I> Don't allow "description" field to shadow Readme.md
diff --git a/src/box.js b/src/box.js index <HASH>..<HASH> 100644 --- a/src/box.js +++ b/src/box.js @@ -100,7 +100,8 @@ Taaspace.Box = (function () { Box.prototype.area = function () { return this.w * this.h; }; - + + // Mutators
.area() added to box.
diff --git a/examples/life.py b/examples/life.py index <HASH>..<HASH> 100644 --- a/examples/life.py +++ b/examples/life.py @@ -153,6 +153,7 @@ def main(): else: time.sleep(0.01) tdl.flush() + tdl.set_title("Conway's Game of Life - %i FPS" % tdl.get_fps()) if __name__ == '__main__':
added FPS counter to life.py
diff --git a/test/scheduler.js b/test/scheduler.js index <HASH>..<HASH> 100644 --- a/test/scheduler.js +++ b/test/scheduler.js @@ -58,8 +58,8 @@ describe('Scheduler', function(){ - describe('#spawnWorker_p', function(done){ - it('properly stores provided data.', function(){ + describe('#spawnWorker_p', function(){ + it('properly stores provided data.', function(done){ //check that we're starting off with no workers. Object.keys(scheduler.$workers).should.be.empty;
Properly placed one more done() callback.
diff --git a/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php b/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php @@ -18,7 +18,7 @@ class DbalLoggerTest extends \PHPUnit_Framework_TestCase */ public function testLog($sql, $params, $logParams) { - $logger = $this->getMock('Symfony\\Component\\HttpKernel\\Log\\LoggerInterface'); + $logger = $this->getMock('Psr\\Log\\LoggerInterface'); $dbalLogger = $this ->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger') @@ -47,7 +47,7 @@ class DbalLoggerTest extends \PHPUnit_Framework_TestCase public function testLogNonUtf8() { - $logger = $this->getMock('Symfony\\Component\\HttpKernel\\Log\\LoggerInterface'); + $logger = $this->getMock('Psr\\Log\\LoggerInterface'); $dbalLogger = $this ->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger')
[Doctrine] removed usage of the deprecated LoggerInterface in some tests
diff --git a/lib/Thelia/Core/Template/Element/BaseLoop.php b/lib/Thelia/Core/Template/Element/BaseLoop.php index <HASH>..<HASH> 100755 --- a/lib/Thelia/Core/Template/Element/BaseLoop.php +++ b/lib/Thelia/Core/Template/Element/BaseLoop.php @@ -69,14 +69,16 @@ abstract class BaseLoop */ public function __construct(ContainerInterface $container) { - $this->checkInterface(); - $this->container = $container; + $this->translator = $container->get("thelia.translator"); + + $this->checkInterface(); + $this->request = $container->get('request'); $this->dispatcher = $container->get('event_dispatcher'); $this->securityContext = $container->get('thelia.securityContext'); - $this->translator = $container->get("thelia.translator"); + $this->args = $this->getArgDefinitions()->addArguments($this->getDefaultArgs(), false); }
instanciate translator before checking loop class interface
diff --git a/tasks/grunt-mochaccino.js b/tasks/grunt-mochaccino.js index <HASH>..<HASH> 100644 --- a/tasks/grunt-mochaccino.js +++ b/tasks/grunt-mochaccino.js @@ -21,6 +21,7 @@ module.exports = function (grunt) { 'use strict'; + var os = require('os'); var fs = require('fs'); var path = require('path'); var spawn = require('child_process').spawn; @@ -50,7 +51,18 @@ module.exports = function (grunt) { grunt.file.mkdir(reportDir); } - var args = ['-R', reporter]; + var args = []; + + // because mocha is a batch file, we have to run it via cmd.exe + // when on Windows + var onWindows = /win/.test(os.platform()); + if (onWindows) { + mocha = 'cmd.exe'; + args = ['/c', 'mocha']; + } + + // add reporter + args = args.concat(['-R', reporter]); var mochaOptions = {stdio: 'inherit'}; var covReportStream = null;
Use cmd.exe to call mocha batch file on Windows
diff --git a/src/leaflet_layer.js b/src/leaflet_layer.js index <HASH>..<HASH> 100755 --- a/src/leaflet_layer.js +++ b/src/leaflet_layer.js @@ -132,7 +132,10 @@ function extendLeaflet(options) { this.modifyScrollWheelBehavior(map); this.modifyDoubleClickZoom(map); debounceMoveEnd = debounce( - function(map) { map._moveEnd(true); }, + function(map) { + map._moveEnd(true); + map.fire('viewreset'); // keep other leaflet layers in sync + }, map.options.wheelDebounceTime * 2 ); this.trackMapLayerCounts(map); @@ -474,7 +477,6 @@ function extendLeaflet(options) { newCenter = map.containerPointToLatLng(viewHalf.add(centerOffset)); var ret = map._move(newCenter, zoom, { flyTo: true }); - map.fire('viewreset'); return ret; };
leaflet layer: call viewreset with moveend
diff --git a/insights/core/dr.py b/insights/core/dr.py index <HASH>..<HASH> 100644 --- a/insights/core/dr.py +++ b/insights/core/dr.py @@ -274,13 +274,16 @@ def get_subgraphs(graph=DEPENDENCIES): def load_components(path, include=".*", exclude="test"): - include = re.compile(include).search if include else lambda x: True - exclude = re.compile(exclude).search if exclude else lambda x: False + do_include = re.compile(include).search if include else lambda x: True + do_exclude = re.compile(exclude).search if exclude else lambda x: False prefix = path.replace('/', '.') + '.' - for _, name, _ in pkgutil.walk_packages(path=[path], prefix=prefix): - if include(name) and not exclude(name): + package = importlib.import_module(path.replace("/", ".")) + for _, name, is_pkg in pkgutil.walk_packages(path=package.__path__, prefix=prefix): + if do_include(name) and not do_exclude(name): log.debug("Importing %s" % name) importlib.import_module(name) + if is_pkg: + load_components(name.replace(".", "/"), include, exclude) def first_of(dependencies, broker):
Fix load_components when importing from eggs.
diff --git a/providers/core.tcpsocket.js b/providers/core.tcpsocket.js index <HASH>..<HASH> 100644 --- a/providers/core.tcpsocket.js +++ b/providers/core.tcpsocket.js @@ -71,8 +71,8 @@ TcpSocket_node.prototype.getInfo = function (callback) { connected: this.connection.state === TcpSocket_node.state.CONNECTED, peerAddress: this.connection.remoteAddress, peerPort: this.connection.remotePort, - localAddress: this.connection.localAddress, - localPort: this.connection.localPort + localAddress: this.connection.address().address, + localPort: this.connection.address().port }); } };
Fix TCP socket provider to pass the unit test. The provider was using |connection.localAddress| to populate the response from getInfo, but node does not fill in |localAddress| for server sockets. However, both client and server sockets provide their local address through the |address()| getter.
diff --git a/salt/utils/http.py b/salt/utils/http.py index <HASH>..<HASH> 100644 --- a/salt/utils/http.py +++ b/salt/utils/http.py @@ -921,6 +921,7 @@ def parse_cookie_header(header): for item in list(cookie): if item in attribs: continue + name = item value = cookie.pop(item) # cookielib.Cookie() requires an epoch
Fix parse_cookie_header function cookie name always None parse_cookie_header function is used when backend is tornado. But cookie name is always None, because programe not set name correct value
diff --git a/tasks.py b/tasks.py index <HASH>..<HASH> 100644 --- a/tasks.py +++ b/tasks.py @@ -6,7 +6,7 @@ from django.conf import settings from celery.decorators import task -from .models import EventWatch +from notifications.models import EventWatch log = logging.getLogger('k.notifications') @@ -29,7 +29,11 @@ def send_notification(content_type, pk, subject, content, exclude=None, emails = [(subject, content, settings.NOTIFICATIONS_FROM_ADDRESS, [w.email]) for w in watchers] - send_mass_mail(emails) + sent = send_mass_mail(emails, fail_silently=True) + + if sent != len(emails): + log.warning('Tried to send %s emails, but only sent %s' % + (len(emails), sent)) @task(rate_limit='4/m')
send_mass_mail() swallows errors and continues [bug <I>]
diff --git a/java/server/src/org/openqa/grid/internal/TestSession.java b/java/server/src/org/openqa/grid/internal/TestSession.java index <HASH>..<HASH> 100644 --- a/java/server/src/org/openqa/grid/internal/TestSession.java +++ b/java/server/src/org/openqa/grid/internal/TestSession.java @@ -306,6 +306,7 @@ public class TestSession { HttpHost host = new HttpHost(remoteURL.getHost(), remoteURL.getPort()); HttpResponse proxyResponse = client.execute(host, proxyRequest); + lastActivity = System.currentTimeMillis(); response.setStatus(proxyResponse.getStatusLine().getStatusCode()); HttpEntity responseBody = proxyResponse.getEntity();
KevinMenard: Update the test session activity when a command response is received as well. r<I>
diff --git a/bazaar/bazaar.py b/bazaar/bazaar.py index <HASH>..<HASH> 100644 --- a/bazaar/bazaar.py +++ b/bazaar/bazaar.py @@ -4,6 +4,7 @@ from fs import open_fs from datetime import datetime import os import six +import re FileAttrs = namedtuple('FileAttrs', ["created", "updated", "name", "size", "namespace"]) @@ -243,7 +244,7 @@ class FileSystem(object): if namespace is None: namespace = self.namespace - name = {"$regex": '^{dir}/([^\/]*)$'.format(dir=path if path != "/" else "")} + name = {"$regex": '^{dir}/([^\/]*)$'.format(dir=re.escape(path) if path != "/" else "")} files = File.objects(namespace=namespace, name=name) return [file.name.split("/")[-1] for file in files] diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ with open('requirements.txt') as fp: setup( name='bazaar', packages=['bazaar'], - version='0.10', + version='0.11', description='Agnostic file storage', author='BMAT developers', author_email='tv-av@bmat.com',
Escape special chars for weird names
diff --git a/lib/mountain_view/engine.rb b/lib/mountain_view/engine.rb index <HASH>..<HASH> 100644 --- a/lib/mountain_view/engine.rb +++ b/lib/mountain_view/engine.rb @@ -31,8 +31,8 @@ module MountainView initializer "mountain_view.add_helpers" do ActiveSupport.on_load :action_controller do - helper MountainView::ApplicationHelper - helper MountainView::ComponentHelper + ::ActionController::Base.helper MountainView::ApplicationHelper + ::ActionController::Base.helper MountainView::ComponentHelper end end end
Fix nomethoderror when including helpers Explicitly calls helper inclusion via ActionController::Base, preventing errors in Rails <I> (Issue#<I>).
diff --git a/plenum/client/client.py b/plenum/client/client.py index <HASH>..<HASH> 100644 --- a/plenum/client/client.py +++ b/plenum/client/client.py @@ -117,7 +117,7 @@ class Client(Motor): if wallet: self.wallet = wallet else: - storage = WalletStorageFile.fromName(name, basedirpath) + storage = WalletStorageFile.fromName(self.name, basedirpath) self.wallet = Wallet(self.name, storage) signers = None # type: Dict[str, Signer]
bug fixed by using the correct client name
diff --git a/builtin/providers/aws/resource_aws_dynamodb_table.go b/builtin/providers/aws/resource_aws_dynamodb_table.go index <HASH>..<HASH> 100644 --- a/builtin/providers/aws/resource_aws_dynamodb_table.go +++ b/builtin/providers/aws/resource_aws_dynamodb_table.go @@ -346,7 +346,10 @@ func resourceAwsDynamoDbTableCreate(d *schema.ResourceData, meta interface{}) er } // Wait, till table is active before imitating any TimeToLive changes - waitForTableToBeActive(d.Id(), meta) + if err := waitForTableToBeActive(d.Id(), meta); err != nil { + log.Printf("[DEBUG] Error waiting for table to be active: %s", err) + return err + } log.Printf("[DEBUG] Setting DynamoDB TimeToLive on arn: %s", tableArn) if timeToLiveOk {
provider/aws: aws_dynamodb_table Add support for TimeToLive. Fix errcheck
diff --git a/Processor.php b/Processor.php index <HASH>..<HASH> 100644 --- a/Processor.php +++ b/Processor.php @@ -376,16 +376,8 @@ class Processor $propertyContainer = $this->getPropertyDefinition($activectx, $property, '@container'); - if (in_array($propertyContainer, array('@language', '@annotation'))) + if (is_object($value) && in_array($propertyContainer, array('@language', '@annotation'))) { - // Expand language and annotation maps - if (false === is_object($value)) - { - throw new SyntaxException( - "Invalid value for \"$property\" detected. It must be an object as it is a @language or @annotation container.", - $value); - } - $result = array(); if ('@language' === $propertyContainer)
Only invoke language and annotation map expansion if the value is a JSON object This addresses #<I> and #<I>.
diff --git a/ssbio/protein/structure/properties/residues.py b/ssbio/protein/structure/properties/residues.py index <HASH>..<HASH> 100644 --- a/ssbio/protein/structure/properties/residues.py +++ b/ssbio/protein/structure/properties/residues.py @@ -57,8 +57,11 @@ def search_ss_bonds(model, threshold=3.0): bridges = [] for cys_pair in pairs: - if cys_pair[0]['SG'] - cys_pair[1]['SG'] < threshold: - bridges.append(cys_pair) + try: + if cys_pair[0]['SG'] - cys_pair[1]['SG'] < threshold: + bridges.append(cys_pair) + except KeyError: # This will occur when a CYS residue is missing a SG atom for some reason + continue infodict = {} if bridges:
Skip over CYS residues with no SG atoms in find_disulfide_bridges (cherry picked from commit d<I>cebe)
diff --git a/sdk/src/api.js b/sdk/src/api.js index <HASH>..<HASH> 100644 --- a/sdk/src/api.js +++ b/sdk/src/api.js @@ -101,6 +101,8 @@ export default class API { async pushModule(name, directory, system = false) { const dest = path.join(system ? SILK_MODULE_ROOT : DATA_MODULE_ROOT, name); + await this.adb('root'); + await this.adb('wait-for-device'); if (system) { await this.adb('remount'); }
adb root before remounting
diff --git a/src/lib.js b/src/lib.js index <HASH>..<HASH> 100644 --- a/src/lib.js +++ b/src/lib.js @@ -28,8 +28,8 @@ const dePseudify = (function () { */ '::?-(?:moz|ms|webkit|o)-[a-z0-9-]+' ], - // Actual regex is of the format: /([^\\])(:hover|:focus)/g - pseudosRegex = new RegExp('([^\\\\])(' + ignoredPseudos.join('|') + ')', 'g'); + // Actual regex is of the format: /([^\\])(:hover|:focus)+/ + pseudosRegex = new RegExp('([^\\\\])(' + ignoredPseudos.join('|') + ')+'); return function (selector) { return selector.replace(pseudosRegex, '$1');
Fix dePseudify() regression when multiple ignored If the `selector` here has multiple pseudo elements attached to it, then this new "escape-aware" regular expression doesn't work without allowing adding a quantifier after the closing parenthesis for the ignored pseudos.
diff --git a/library/Public.php b/library/Public.php index <HASH>..<HASH> 100644 --- a/library/Public.php +++ b/library/Public.php @@ -136,11 +136,10 @@ if (!function_exists('municipio_get_mime_link_item')) { if (!function_exists('municipio_to_aspect_ratio')) { function municipio_to_aspect_ratio($ratio, $size) { - $ratio = explode(':', $ratio); - - $width = round($size[0]); - $height = round(($width / $ratio[0]) * $ratio[1]); - + if (count($ratio = explode(":", $ratio)) == 2) { + $width = round($size[0]); + $height = round(($width / $ratio[0]) * $ratio[1]); + } return array($width, $height); } }
Check that ratio is set before calculating.
diff --git a/merb-gen/lib/generators/merb/merb_flat.rb b/merb-gen/lib/generators/merb/merb_flat.rb index <HASH>..<HASH> 100644 --- a/merb-gen/lib/generators/merb/merb_flat.rb +++ b/merb-gen/lib/generators/merb/merb_flat.rb @@ -16,6 +16,8 @@ module Merb::Generators glob! + empty_directory :gems, 'gems' + def destination_root File.join(@destination_root, base_name) end diff --git a/merb-gen/lib/generators/merb/merb_full.rb b/merb-gen/lib/generators/merb/merb_full.rb index <HASH>..<HASH> 100644 --- a/merb-gen/lib/generators/merb/merb_full.rb +++ b/merb-gen/lib/generators/merb/merb_full.rb @@ -20,6 +20,8 @@ module Merb::Generators glob! + empty_directory :gems, 'gems' + first_argument :name, :required => true, :desc => "Application name" invoke :layout do |generator|
Added empty ./gems dir for merb-gen app (and --flat)
diff --git a/indra/assemblers/__init__.py b/indra/assemblers/__init__.py index <HASH>..<HASH> 100644 --- a/indra/assemblers/__init__.py +++ b/indra/assemblers/__init__.py @@ -38,3 +38,7 @@ try: from indra.assemblers.pybel_assembler import PybelAssembler except ImportError: pass +try: + from indra.assemblers.figaro_assembler import FigaroAssembler +except ImportError: + pass
Expose Figaro assembler in assemblers module
diff --git a/src/org/jgroups/protocols/pbcast/FLUSH.java b/src/org/jgroups/protocols/pbcast/FLUSH.java index <HASH>..<HASH> 100644 --- a/src/org/jgroups/protocols/pbcast/FLUSH.java +++ b/src/org/jgroups/protocols/pbcast/FLUSH.java @@ -523,8 +523,7 @@ public class FLUSH extends Protocol } private void onStartFlush(Address flushStarter, FlushHeader fh) - { - isBlockState = true; + { if (stats) { startFlushTime = System.currentTimeMillis(); @@ -569,10 +568,11 @@ public class FLUSH extends Protocol if (flushOkCompleted) { + isBlockState = true; m.putHeader(getName(), new FlushHeader(FlushHeader.FLUSH_COMPLETED, viewID)); passDown(new Event(Event.MSG, m)); if (log.isDebugEnabled()) - log.debug(localAddress + " sent FLUSH_COMPLETED message to " + flushCaller); + log.debug(localAddress + " is blocking FLUSH.down(). Sent FLUSH_COMPLETED message to " + flushCaller); } }
moved blocking on FLUSH.down() from START_FLUSH to FLUSH_OK
diff --git a/gym/lib/gym/version.rb b/gym/lib/gym/version.rb index <HASH>..<HASH> 100644 --- a/gym/lib/gym/version.rb +++ b/gym/lib/gym/version.rb @@ -1,4 +1,4 @@ module Gym - VERSION = "1.8.0" + VERSION = "1.9.0" DESCRIPTION = "Building your iOS apps has never been easier" end
Version Bump (#<I>)
diff --git a/src/satosa/satosa_config.py b/src/satosa/satosa_config.py index <HASH>..<HASH> 100644 --- a/src/satosa/satosa_config.py +++ b/src/satosa/satosa_config.py @@ -50,7 +50,7 @@ class SATOSAConfig(object): self._config["INTERNAL_ATTRIBUTES"] = _internal_attributes break if not self._config["INTERNAL_ATTRIBUTES"]: - raise SATOSAConfigurationError("Coudl not load attribute mapping from 'INTERNAL_ATTRIBUTES.") + raise SATOSAConfigurationError("Could not load attribute mapping from 'INTERNAL_ATTRIBUTES.") def _verify_dict(self, conf): """
Fix typo in exception in SATOSAConfig constructor.
diff --git a/src/bundle/Controller/ContentOnTheFlyController.php b/src/bundle/Controller/ContentOnTheFlyController.php index <HASH>..<HASH> 100644 --- a/src/bundle/Controller/ContentOnTheFlyController.php +++ b/src/bundle/Controller/ContentOnTheFlyController.php @@ -295,14 +295,6 @@ class ContentOnTheFlyController extends Controller ? $this->contentActionDispatcher : $this->createContentActionDispatcher; - if (!$location instanceof Location) { - $contentInfo = $this->contentService->loadContentInfo($content->id); - - if (!empty($contentInfo->mainLocationId)) { - $location = $this->locationService->loadLocation($contentInfo->mainLocationId); - } - } - $actionDispatcher->dispatchFormAction( $form, $form->getData(), @@ -310,6 +302,14 @@ class ContentOnTheFlyController extends Controller ['referrerLocation' => $location] ); + if (!$location instanceof Location) { + $contentInfo = $this->contentService->loadContentInfo($content->id); + + if (null !== $contentInfo->mainLocationId) { + $location = $this->locationService->loadLocation($contentInfo->mainLocationId); + } + } + if ($actionDispatcher->getResponse()) { $view = new EditContentOnTheFlySuccessView('@ezdesign/ui/on_the_fly/content_edit_response.html.twig'); $view->addParameters([
EZP-<I>: Fixed CotF blank screen after publishing (#<I>)
diff --git a/code/javascript/core/scripts/selenium-api.js b/code/javascript/core/scripts/selenium-api.js index <HASH>..<HASH> 100644 --- a/code/javascript/core/scripts/selenium-api.js +++ b/code/javascript/core/scripts/selenium-api.js @@ -880,7 +880,7 @@ Selenium.prototype.getWhetherThisWindowMatchWindowExpression = function(currentW * @param target new window (which might be relative to the current one, e.g., "_parent") * @return boolean true if the new window is this code's window */ - if (window.opener!=null && window.opener["target"]!=null && window.opener["target"]==window) { + if (window.opener!=null && window.opener[target]!=null && window.opener[target]==window) { return true; } return false;
Fix problem in getWhetherThisWindowMatchWindowExpression: use the value of the variable target, not the literal string "target" r<I>
diff --git a/src/python/turicreate/toolkits/activity_classifier/_activity_classifier.py b/src/python/turicreate/toolkits/activity_classifier/_activity_classifier.py index <HASH>..<HASH> 100644 --- a/src/python/turicreate/toolkits/activity_classifier/_activity_classifier.py +++ b/src/python/turicreate/toolkits/activity_classifier/_activity_classifier.py @@ -191,7 +191,6 @@ def create(dataset, session_id, target, features=None, prediction_window=100, options['prediction_window'] = prediction_window options['batch_size'] = batch_size options['max_iterations'] = max_iterations - options['use_tensorflow'] = params['use_tensorflow'] model.train(dataset, target, session_id, validation_set, options) return ActivityClassifier_beta(model_proxy=model, name=name)
Activity classifier bug fix: don't pass unrecognized options to C++ (#<I>)
diff --git a/src/Model/Draft/CategoryDraft.php b/src/Model/Draft/CategoryDraft.php index <HASH>..<HASH> 100644 --- a/src/Model/Draft/CategoryDraft.php +++ b/src/Model/Draft/CategoryDraft.php @@ -11,7 +11,6 @@ use Sphere\Core\Model\OfTrait; use Sphere\Core\Model\Type\CategoryReference; use Sphere\Core\Model\Type\JsonObject; use Sphere\Core\Model\Type\LocalizedString; -use Sphere\Core\Model\Type\Reference; /** * Class CategoryDraft diff --git a/src/Request/AbstractQueryRequest.php b/src/Request/AbstractQueryRequest.php index <HASH>..<HASH> 100644 --- a/src/Request/AbstractQueryRequest.php +++ b/src/Request/AbstractQueryRequest.php @@ -22,10 +22,11 @@ abstract class AbstractQueryRequest extends AbstractApiRequest use SortTrait; /** - * @param $where - * @param $sort - * @param $limit - * @param $offset + * @param \Sphere\Core\Http\JsonEndpoint $endpoint + * @param null $where + * @param null $sort + * @param null $limit + * @param null $offset */ public function __construct($endpoint, $where = null, $sort = null, $limit = null, $offset = null) {
removed unused statement, update doc block for abstract query request
diff --git a/code/media/koowa/com_koowa/js/koowa.select2.js b/code/media/koowa/com_koowa/js/koowa.select2.js index <HASH>..<HASH> 100644 --- a/code/media/koowa/com_koowa/js/koowa.select2.js +++ b/code/media/koowa/com_koowa/js/koowa.select2.js @@ -29,7 +29,14 @@ //Workaround for Select2 refusing to ajaxify select elements if (element.get(0).tagName.toLowerCase() === "select") { + var data = element.children(); + element.empty(); + element.get(0).typeName = 'input'; + + var newElement = $('<input />'); + var replaced = element.replaceWith(newElement); + element = newElement; } element.select2(settings);
re #<I> first version of <select> workaround
diff --git a/src/main/java/org/jmxtrans/embedded/output/StackdriverWriter.java b/src/main/java/org/jmxtrans/embedded/output/StackdriverWriter.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jmxtrans/embedded/output/StackdriverWriter.java +++ b/src/main/java/org/jmxtrans/embedded/output/StackdriverWriter.java @@ -218,7 +218,7 @@ public class StackdriverWriter extends AbstractOutputWriter implements OutputWri String inputLine = null; final URL metadataUrl = new URL("http://169.254.169.254/latest/meta-data/instance-id"); URLConnection metadataConnection = metadataUrl.openConnection(); - BufferedReader in = new BufferedReader(new InputStreamReader(metadataConnection.getInputStream())); + BufferedReader in = new BufferedReader(new InputStreamReader(metadataConnection.getInputStream(), "UTF-8")); while ((inputLine = in.readLine()) != null) { detectedInstanceId = inputLine; }
use UTF-8 instead of relying on default charset, solves findBugs issue as well as being better form in general
diff --git a/tilequeue/utils.py b/tilequeue/utils.py index <HASH>..<HASH> 100644 --- a/tilequeue/utils.py +++ b/tilequeue/utils.py @@ -32,12 +32,12 @@ def grouper(iterable, n): def parse_log_file(log_file): - ip_pattern = '(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' + ip_pattern = r'(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' # didn't match againts explicit date pattern, in case it changes - date_pattern = '\[([\d\w\s\/:]+)\]' - tile_id_pattern = '\/([\w]+)\/([\d]+)\/([\d]+)\/([\d]+)\.([\d\w]*)' + date_pattern = r'\[([\d\w\s\/:]+)\]' + tile_id_pattern = r'\/([\w]+)\/([\d]+)\/([\d]+)\/([\d]+)\.([\d\w]*)' - log_pattern = '%s - - %s "([\w]+) %s.*' % ( + log_pattern = r'%s - - %s "([\w]+) %s.*' % ( ip_pattern, date_pattern, tile_id_pattern) tile_log_records = []
Use raw strings for patterns with regular expression rather than Python escape sequences.
diff --git a/boundary/metric_modify.py b/boundary/metric_modify.py index <HASH>..<HASH> 100644 --- a/boundary/metric_modify.py +++ b/boundary/metric_modify.py @@ -13,8 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from boundary import MetricCommon import json +import logging + +from boundary import MetricCommon """ Common Base class for defining and update metric definitions @@ -98,12 +100,12 @@ class MetricModify (MetricCommon): if self.aggregate is not None: data['defaultAggregate'] = self.aggregate if self.unit is not None: - data['unit'] = self.unit, + data['unit'] = self.unit if self.resolution is not None: data['defaultResolutionMS'] = self.resolution if self.isDisabled is not None: data['isDisabled'] = self.isDisabled - + self.path = "v1/metrics/{0}".format(self.metricName) self.data = json.dumps(data, sort_keys=True) self.headers = {'Content-Type': 'application/json', "Accept": "application/json"}
Superious comma was sending tuple which translated to a JSON array and caused and error
diff --git a/lib/omnibus.rb b/lib/omnibus.rb index <HASH>..<HASH> 100644 --- a/lib/omnibus.rb +++ b/lib/omnibus.rb @@ -86,13 +86,28 @@ module Omnibus generate_extra_rake_tasks end - # All the {Omnibus::Project} objects that have been created. + # All {Omnibus::Project} instances that have been created. # # @return [Array<Omnibus::Project>] def self.projects @projects ||= [] end + # Names of all the {Omnibus::Project} instances that have been created. + # + # @return [Array<String>] + def self.project_names + projects.map{|p| p.name} + end + + # Load the {Omnibus::Project} instance with the given name. + # + # @param name [String] + # @return {Omnibus::Project} + def self.project(name) + projects.find{ |p| p.name == name} + end + # The absolute path to the Omnibus project/repository directory. # # @return [String]
Add `Omnibus.projects` and `Omnibus.project` methods These helpers aid in common project-related tasks.
diff --git a/lib/expression/expression.js b/lib/expression/expression.js index <HASH>..<HASH> 100644 --- a/lib/expression/expression.js +++ b/lib/expression/expression.js @@ -501,7 +501,7 @@ Expression.setMethod(function getTokenValuesArray(tokens, vars) { * * @author Jelle De Loecker <jelle@develry.be> * @since 1.3.3 - * @version 1.3.3 + * @version 2.0.0 * * @param {Array} path * @param {Array} args @@ -538,7 +538,7 @@ Expression.setMethod(function callPathWithArgs(path, args, vars) { } if (!context || !fnc) { - throw new Error('Unable to call path "' + path.join('.') + '"'); + return undefined; } args = this.getTokenValuesArray(args, vars); diff --git a/test/10-expressions.js b/test/10-expressions.js index <HASH>..<HASH> 100644 --- a/test/10-expressions.js +++ b/test/10-expressions.js @@ -276,6 +276,15 @@ describe('Expressions', function() { createTests(tests); }); + + describe('None existing method calls', function() { + + var tests = [ + [`{%= empty_arr.does_not_exist() or 'nope' %}`, 'nope'], + ]; + + createTests(tests); + }); }); function createTests(tests) {
Calling a non-existant method in a hawkejs expression will not throw an error but return undefined
diff --git a/webview/win32.py b/webview/win32.py index <HASH>..<HASH> 100644 --- a/webview/win32.py +++ b/webview/win32.py @@ -159,9 +159,9 @@ class BrowserView(object): atl_width = self.width - self.scrollbar_width atl_height = self.height - self.scrollbar_height - VERTICAL_SCROLLBAR_OFFSET - self.atlhwnd = win32gui.CreateWindow("AtlAxWin", self.url, - win32con.WS_CHILD | win32con.WS_HSCROLL | win32con.WS_VSCROLL, - 0, 0, atl_width, atl_height, self.hwnd, None, hInstance, None) + self.atlhwnd = win32gui.CreateWindow("AtlAxWin", "bogus-url", + win32con.WS_CHILD | win32con.WS_HSCROLL | win32con.WS_VSCROLL, + 0, 0, atl_width, atl_height, self.hwnd, None, hInstance, None) # COM voodoo pBrowserUnk = POINTER(IUnknown)() @@ -181,6 +181,9 @@ class BrowserView(object): win32gui.UpdateWindow(self.atlhwnd) win32gui.SetFocus(self.atlhwnd) + # Load URL here instead in CreateWindow to prevent a dead-lock + self.browser.Navigate2(self.url) + # Start sending and receiving messages win32gui.PumpMessages()
Change how URL is loaded on an initial window display in Windows
diff --git a/salt/utils/find.py b/salt/utils/find.py index <HASH>..<HASH> 100644 --- a/salt/utils/find.py +++ b/salt/utils/find.py @@ -495,6 +495,9 @@ class Finder(object): _REQUIRES_STAT: list(), _REQUIRES_CONTENTS: list()} for key, value in options.iteritems(): + if key.startswith('_'): + # this is a passthrough object, continue + continue if value is None or len(value) == 0: raise ValueError('missing value for "{0}" option'.format(key)) try:
Check for transparent objects in file finder, fix # <I>
diff --git a/config/platform/windows.rb b/config/platform/windows.rb index <HASH>..<HASH> 100644 --- a/config/platform/windows.rb +++ b/config/platform/windows.rb @@ -413,7 +413,11 @@ module RightScale class Controller # Shutdown machine now def shutdown - `shutdown -s -f -t 01` + # Eww, we can't just call the normal shutdown on 64bit because of bitness + # Hack that will work on EC2, need to find a better way... + cmd = "c:\\WINDOWS\\ServicePackFiles\\amd64\\shutdown.exe" + cmd = 'shutdown.exe' unless File.exists?(cmd) + `#{cmd} -s -f -t 01` end end
Make shutdown work on Windows <I> bit
diff --git a/lib/devise_security_extension/models/password_archivable.rb b/lib/devise_security_extension/models/password_archivable.rb index <HASH>..<HASH> 100644 --- a/lib/devise_security_extension/models/password_archivable.rb +++ b/lib/devise_security_extension/models/password_archivable.rb @@ -10,7 +10,7 @@ module Devise # :nodoc: base.class_eval do include InstanceMethods has_many :old_passwords, :as => :password_archivable, :class_name => "OldPassword" - before_save :archive_password + before_update :archive_password validate :validate_password_archive end end
Fix: Save old password in archive only on update
diff --git a/src/notebook/reducers/document.js b/src/notebook/reducers/document.js index <HASH>..<HASH> 100644 --- a/src/notebook/reducers/document.js +++ b/src/notebook/reducers/document.js @@ -56,10 +56,10 @@ export default handleActions({ [constants.TOGGLE_STICKY_CELL]: function toggleStickyCell(state, action) { const { id } = action; const stickyCells = state.get('stickyCells'); - if (stickyCells.get(id)) { + if (stickyCells.has(id)) { return state.set('stickyCells', stickyCells.delete(id)); } - return state.setIn(['stickyCells', id], true); + return state.set('stickyCells', stickyCells.add(id)); }, [constants.UPDATE_CELL_EXECUTION_COUNT]: function updateExecutionCount(state, action) { const { id, count } = action;
refactor(reducers): Use Immutable.Set in toggleStickyCell
diff --git a/packages/grpc-native-core/gulpfile.js b/packages/grpc-native-core/gulpfile.js index <HASH>..<HASH> 100644 --- a/packages/grpc-native-core/gulpfile.js +++ b/packages/grpc-native-core/gulpfile.js @@ -68,7 +68,7 @@ gulp.task('build', 'Build native package', () => { }); gulp.task('test', 'Run all tests', ['build'], () => { - return gulp.src(`${testDir}/*.js`).pipe(mocha({reporter: 'mocha-jenkins-reporter'})); + return gulp.src(`${testDir}/*.js`).pipe(mocha({timeout: 5000, reporter: 'mocha-jenkins-reporter'})); }); gulp.task('doc.gen', 'Generate docs', (cb) => {
Increasing mocha timeout to 5s up from 2s. Our fleet of macos is a bit less powerful than the rest, so we regularly flake tests there due to this timeout.
diff --git a/tests/status_code.py b/tests/status_code.py index <HASH>..<HASH> 100644 --- a/tests/status_code.py +++ b/tests/status_code.py @@ -5,19 +5,11 @@ # license that can be found in the LICENSE file. from .fake_webapp import EXAMPLE_APP -from splinter.request_handler.status_code import HttpResponseError class StatusCodeTest(object): - # def test_should_visit_an_absent_page_and_get_an_404_error(self): - # with self.assertRaises(HttpResponseError): - # self.browser.visit(EXAMPLE_APP + "this_page_does_not_exists") - def test_should_visit_index_of_example_app_and_get_200_status_code(self): self.browser.visit(EXAMPLE_APP) self.assertEqual(200, self.browser.status_code) - - def test_should_be_able_to_print_status_code_with_reason(self): - self.browser.visit(EXAMPLE_APP) self.assertEqual('200 - OK', str(self.browser.status_code))
tests/status_code: join status ok tests
diff --git a/babylon-to-espree/toAST.js b/babylon-to-espree/toAST.js index <HASH>..<HASH> 100644 --- a/babylon-to-espree/toAST.js +++ b/babylon-to-espree/toAST.js @@ -206,11 +206,6 @@ var astTransformVisitor = { } } - // remove class property keys (or patch in escope) - if (path.isClassProperty()) { - delete node.key; - } - // async function as generator if (path.isFunction()) { if (node.async) node.generator = true; diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -229,6 +229,13 @@ function monkeypatch() { // visit decorators that are in: ClassDeclaration / ClassExpression var visitClass = referencer.prototype.visitClass; referencer.prototype.visitClass = function(node) { + var classBody = node.body.body; + for (var a = 0; a < classBody.length; a++) { + if (classBody[a].type === "ClassProperty") { + createScopeVariable.call(this, classBody[a], classBody[a].key); + } + } + visitDecorators.call(this, node); var typeParamScope; if (node.typeParameters) {
Create a variable for class properties in scope instead of deleting the key (#<I>)
diff --git a/pyoko/db/queryset.py b/pyoko/db/queryset.py index <HASH>..<HASH> 100644 --- a/pyoko/db/queryset.py +++ b/pyoko/db/queryset.py @@ -171,7 +171,9 @@ class QuerySet(object): _pass_perm_checks=self._pass_perm_checks) model.setattr('key', ub_to_str(key) if key else ub_to_str(data.get('key'))) - return model.set_data(data, from_db=True) + model = model.set_data(data, from_db=True) + model._initial_data = model._data + return model def __repr__(self): if not self.is_clone:
ADD: make `make_model` method to set initial data attr to track changes rref #<I>
diff --git a/src/ORM/Association/HasMany.php b/src/ORM/Association/HasMany.php index <HASH>..<HASH> 100644 --- a/src/ORM/Association/HasMany.php +++ b/src/ORM/Association/HasMany.php @@ -16,6 +16,8 @@ namespace Cake\ORM\Association; use Cake\Collection\Collection; +use Cake\Database\Expression\FieldInterface; +use Cake\Database\Expression\QueryExpression; use Cake\Datasource\EntityInterface; use Cake\ORM\Association; use Cake\ORM\Table; @@ -436,6 +438,12 @@ class HasMany extends Association if ($mustBeDependent) { if ($this->_cascadeCallbacks) { + $conditions = new QueryExpression($conditions); + $conditions->traverse(function ($entry) use ($target) { + if ($entry instanceof FieldInterface) { + $entry->setField($target->aliasField($entry->getField())); + } + }); $query = $this->find('all')->where($conditions); $ok = true; foreach ($query as $assoc) {
Update HasMany to avoid ambigous columns I've changed the conditions from a basic array to a QueryExpression, which I aftewards traverse to add alias to all fields.
diff --git a/pynYNAB/Client.py b/pynYNAB/Client.py index <HASH>..<HASH> 100644 --- a/pynYNAB/Client.py +++ b/pynYNAB/Client.py @@ -123,7 +123,7 @@ class nYnabClient(object): request_data = dict(starting_device_knowledge=self.current_device_knowledge[opname], ending_device_knowledge=self.current_device_knowledge[opname], device_knowledge_of_server=self.device_knowledge_of_server[opname], - changed_entities={}) + changed_entities=changed_entities) request_data.update(extra) sync_data = self.connection.dorequest(request_data, opname)
regression to not being able to push changed entities
diff --git a/openpnm/utils/Workspace.py b/openpnm/utils/Workspace.py index <HASH>..<HASH> 100644 --- a/openpnm/utils/Workspace.py +++ b/openpnm/utils/Workspace.py @@ -344,7 +344,7 @@ class Workspace(dict): # If _next_id has not been set, then assign it self._next_id = 0 # But check ids in any objects present first - for proj in self: + for proj in self.values(): if 'pore._id' in proj.network.keys(): Pmax = proj.network['pore._id'].max() + 1 Tmax = proj.network['throat._id'].max() + 1
fixing bug in id gen
diff --git a/unleash/plugins/tox_tests.py b/unleash/plugins/tox_tests.py index <HASH>..<HASH> 100644 --- a/unleash/plugins/tox_tests.py +++ b/unleash/plugins/tox_tests.py @@ -38,6 +38,6 @@ def lint_release(ctx): with VirtualEnv.temporary() as ve, in_tmpexport(ctx['commit']): ve.pip_install('tox') ctx['log'].debug('Running tests using tox') - ve.check_output(['tox']) + ve.check_output(ve.get_binary('tox')) except subprocess.CalledProcessError as e: ctx['issues'].error('tox testing failed:\n{}'.format(e.output))
Use get_binary in tox tests.
diff --git a/aiohttp/web_urldispatcher.py b/aiohttp/web_urldispatcher.py index <HASH>..<HASH> 100644 --- a/aiohttp/web_urldispatcher.py +++ b/aiohttp/web_urldispatcher.py @@ -859,9 +859,10 @@ class UrlDispatcher(AbstractRouter, collections.abc.Mapping): route is added allowing head requests to the same endpoint """ if allow_head: - # the head route can't have "name" set or it would conflict with + # it name is not None append -head to avoid it conflicting with # the GET route below - self.add_route(hdrs.METH_HEAD, *args, **kwargs) + head_name = name and '{}-head'.format(name) + self.add_route(hdrs.METH_HEAD, *args, name=head_name, **kwargs) return self.add_route(hdrs.METH_GET, *args, name=name, **kwargs) def add_post(self, *args, **kwargs):
fix allow-head to include name on route
diff --git a/concurrency/fields.py b/concurrency/fields.py index <HASH>..<HASH> 100755 --- a/concurrency/fields.py +++ b/concurrency/fields.py @@ -88,7 +88,7 @@ class VersionField(Field): def contribute_to_class(self, cls, name, virtual_only=False): super(VersionField, self).contribute_to_class(cls, name) - if hasattr(cls, '_concurrencymeta'): + if hasattr(cls, '_concurrencymeta') or cls._meta.abstract: return setattr(cls, '_concurrencymeta', ConcurrencyOptions()) cls._concurrencymeta._field = self @@ -197,7 +197,8 @@ class TriggerVersionField(VersionField): form_class = forms.VersionField def contribute_to_class(self, cls, name, virtual_only=False): - _TRIGGERS.append(self) + if not cls._meta.abstract: + _TRIGGERS.append(self) super(TriggerVersionField, self).contribute_to_class(cls, name) def _get_next_version(self, model_instance):
Don't create triggers on abstract classes Abstract classes have no database table, so creating a trigger for them causes an error. This patch checks that `cls._meta.abstract` is False before adding the trigger to the `TRIGGERS` list.
diff --git a/src/CyberSpectrum/Command/CommandBase.php b/src/CyberSpectrum/Command/CommandBase.php index <HASH>..<HASH> 100644 --- a/src/CyberSpectrum/Command/CommandBase.php +++ b/src/CyberSpectrum/Command/CommandBase.php @@ -230,7 +230,7 @@ abstract class CommandBase extends Command } if (!$this->skipFiles) { - $this->skipFiles = $this->getConfigValue('/transifex/skip_files'); + $this->skipFiles = $this->getTransifexConfigValue('/skip_files'); } else { // Make sure it is an array $this->skipFiles = array();
Adjusted loading the skip files config from configurable config path
diff --git a/src/Formatter/Coordinate/DMS.php b/src/Formatter/Coordinate/DMS.php index <HASH>..<HASH> 100644 --- a/src/Formatter/Coordinate/DMS.php +++ b/src/Formatter/Coordinate/DMS.php @@ -61,7 +61,7 @@ class DMS implements FormatterInterface { $this->separator = $separator; $this->useCardinalLetters = false; - $this->setUnits(static::UNITS_UTF8); + $this->setUnits(self::UNITS_UTF8); } /** diff --git a/src/Formatter/Coordinate/DecimalMinutes.php b/src/Formatter/Coordinate/DecimalMinutes.php index <HASH>..<HASH> 100644 --- a/src/Formatter/Coordinate/DecimalMinutes.php +++ b/src/Formatter/Coordinate/DecimalMinutes.php @@ -68,7 +68,7 @@ class DecimalMinutes implements FormatterInterface $this->separator = $separator; $this->useCardinalLetters = false; - $this->setUnits(static::UNITS_UTF8); + $this->setUnits(self::UNITS_UTF8); } /**
don't use late static binding for class constants
diff --git a/app/Elements/IndividualRecord.php b/app/Elements/IndividualRecord.php index <HASH>..<HASH> 100644 --- a/app/Elements/IndividualRecord.php +++ b/app/Elements/IndividualRecord.php @@ -60,6 +60,7 @@ class IndividualRecord extends AbstractElement 'IDNO' => '0:M', 'IMMI' => '0:M', 'NAME' => '0:M', + 'NATI' => '0:M', 'NATU' => '0:M', 'NCHI' => '0:M', 'NMR' => '0:M',
added NATI - nationality (#<I>)
diff --git a/stdeb/command/bdist_deb.py b/stdeb/command/bdist_deb.py index <HASH>..<HASH> 100644 --- a/stdeb/command/bdist_deb.py +++ b/stdeb/command/bdist_deb.py @@ -1,6 +1,5 @@ import os import stdeb.util as util -from stdeb.command.sdist_dsc import sdist_dsc from distutils.core import Command @@ -22,8 +21,11 @@ class bdist_deb(Command): # generate .dsc source pkg self.run_command('sdist_dsc') + # get relevant options passed to sdist_dsc + sdist_dsc = self.get_finalized_command('sdist_dsc') + dsc_tree = sdist_dsc.dist_dir + # execute system command and read output (execute and read output of find cmd) - dsc_tree = 'deb_dist' target_dir = None for entry in os.listdir(dsc_tree): fulldir = os.path.join(dsc_tree,entry)
bdist_deb: get dist_dir option passed to sdist_dsc command
diff --git a/lib/models/index.js b/lib/models/index.js index <HASH>..<HASH> 100644 --- a/lib/models/index.js +++ b/lib/models/index.js @@ -1,4 +1,4 @@ - +require('mongoose').models = {}; module.exports = { InviteCode: require('./invite'), Job: require('./job'),
fix mongoose models code reloading issue
diff --git a/lib/pluginlib.php b/lib/pluginlib.php index <HASH>..<HASH> 100644 --- a/lib/pluginlib.php +++ b/lib/pluginlib.php @@ -221,12 +221,18 @@ class plugin_manager { /** * Returns a localized name of a given plugin * - * @param string $plugin name of the plugin, eg mod_workshop or auth_ldap + * @param string $component name of the plugin, eg mod_workshop or auth_ldap * @return string */ - public function plugin_name($plugin) { - list($type, $name) = normalize_component($plugin); - return $this->pluginsinfo[$type][$name]->displayname; + public function plugin_name($component) { + + $pluginfo = $this->get_plugin_info($component); + + if (is_null($pluginfo)) { + throw new moodle_exception('err_unknown_plugin', 'core_plugin', '', array('plugin' => $component)); + } + + return $pluginfo->displayname; } /**
MDL-<I> Fix plugin_manager::plugin_name() implementation This is not directly related to the issue. However, it turned out that if this method was called on plugin_manager without loaded plugins, it would throw an error. This new implementation uses cleaner access to the plugininfo subclass.
diff --git a/scripts/code-viewer.js b/scripts/code-viewer.js index <HASH>..<HASH> 100644 --- a/scripts/code-viewer.js +++ b/scripts/code-viewer.js @@ -172,6 +172,7 @@ let encoded = this.responseText; encoded = window.html_beautify(encoded, {indent_size: 2, wrap_line_length: 0}); encoded = window.he.encode(encoded); + encoded = encoded.replace(/^\s*$\n/gm, ''); // Delete empty lines. codeViewer.encoded = encoded; if (codeViewer.tabActive === 'e') {
further beautification of html code in viewer
diff --git a/spyder/plugins/projects/plugin.py b/spyder/plugins/projects/plugin.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/projects/plugin.py +++ b/spyder/plugins/projects/plugin.py @@ -266,9 +266,15 @@ class Projects(SpyderPluginWidget): dlg.sig_project_creation_requested.connect(self._create_project) dlg.sig_project_creation_requested.connect(self.sig_project_created) if dlg.exec_(): - if (active_project is None - and self.get_option('visible_if_project_open')): - self.show_explorer() + # A project was not open before + if active_project is None: + if self.get_option('visible_if_project_open'): + self.show_explorer() + else: + # We are switching projects. + # TODO: Don't emit sig_project_closed when we support + # multiple workspaces. + self.sig_project_closed.emit(active_project.root_path) self.sig_pythonpath_changed.emit() self.restart_consoles() @@ -312,6 +318,11 @@ class Projects(SpyderPluginWidget): self.set_project_filenames( self.main.editor.get_open_filenames()) + # TODO: Don't emit sig_project_closed when we support + # multiple workspaces. + self.sig_project_closed.emit( + self.current_active_project.root_path) + project = EmptyProject(path) self.current_active_project = project self.latest_project = project
Projects: Emit sig_project_closed when switching projects - This can happen either when you have an open project and (i) Change to another, existing project; or (ii) Create a new project. - It's important to emit that signal to let the LSP know that the previous open project needs to be removed from the workspace. - This won't be necessary once we support multiple workspaces in the interface, but for now it is.
diff --git a/src/Auditable.php b/src/Auditable.php index <HASH>..<HASH> 100644 --- a/src/Auditable.php +++ b/src/Auditable.php @@ -55,7 +55,10 @@ trait Auditable */ public function audits() { - return $this->morphMany(Config::get('audit.implementation'), 'auditable'); + return $this->morphMany( + Config::get('audit.implementation', \OwenIt\Auditing\Models\Audit::class), + 'auditable' + ); } /**
fix(Auditable): set OwenIt\Auditing\Models\Audit as default Audit implementation
diff --git a/logging/mock.go b/logging/mock.go index <HASH>..<HASH> 100644 --- a/logging/mock.go +++ b/logging/mock.go @@ -57,12 +57,12 @@ func (m writerMap) CheckWrittenAtLevel(t *testing.T, lv LogLevel, exp string) { } else { w = m[lv] } - if len(w.written) < 32 { + // 32 bytes covers the date, time and filename up to the colon in + // 2011/10/22 10:22:57 log_test.go:<line no>: <level> <log message> + if len(w.written) <= 32 { t.Errorf("Not enough bytes logged at level %s:", LogString(lv)) t.Errorf("\tgot: %s", string(w.written)) } - // 32 bytes covers the date, time and filename up to the colon in - // 2011/10/22 10:22:57 log_test.go:<line no>: <level> <log message> s := string(w.written[32:]) // 2 covers the : itself and the extra space idx := strings.Index(s, ":") + 2
Hmm, slice out of range error, wtf x2.
diff --git a/src/editor/ImageViewer.js b/src/editor/ImageViewer.js index <HASH>..<HASH> 100644 --- a/src/editor/ImageViewer.js +++ b/src/editor/ImageViewer.js @@ -205,6 +205,7 @@ define(function (require, exports, module) { function render(fullPath) { var relPath = ProjectManager.makeProjectRelativeIfPossible(fullPath); + _scale = 100; // initialize to 100 $("#img-path").text(relPath); $("#img-preview").on("load", function () { // add dimensions and size @@ -235,7 +236,6 @@ define(function (require, exports, module) { $("#img").on("mousemove", "#img-preview, #img-scale", _showImageTip) .on("mouseleave", "#img-preview, #img-scale", _hideImageTip); - _scale = 100; // initialize to 100 _updateScale($(this).width()); }); }
Moving the initialization to the top of render function.
diff --git a/src/Models/Tenant.php b/src/Models/Tenant.php index <HASH>..<HASH> 100644 --- a/src/Models/Tenant.php +++ b/src/Models/Tenant.php @@ -132,8 +132,6 @@ class Tenant extends BaseTenant implements HasMedia $this->mergeCasts(['social' => 'array', 'style' => 'string']); $this->mergeRules(['social' => 'nullable', 'style' => 'nullable|string|strip_tags|max:150', 'tags' => 'nullable|array']); - - $this->setTable(config('rinvex.tenants.tables.tenants')); } /**
Remove duplicate `setTable` method call override as it's already called in parent class
diff --git a/nanoget/nanoget.py b/nanoget/nanoget.py index <HASH>..<HASH> 100644 --- a/nanoget/nanoget.py +++ b/nanoget/nanoget.py @@ -265,7 +265,7 @@ def process_fastq_plain(fastq, threads): pool = Pool(processes=threads) try: output = [results for results in pool.imap( - extract_from_fastq, SeqIO.parse(inputfastq, "fastq")) if not results is None] + extract_from_fastq, SeqIO.parse(inputfastq, "fastq")) if results is not None] except KeyboardInterrupt: sys.stderr.write("Terminating worker threads") pool.terminate()
change not is None to is not None
diff --git a/code/forms/Users_RegisterForm.php b/code/forms/Users_RegisterForm.php index <HASH>..<HASH> 100755 --- a/code/forms/Users_RegisterForm.php +++ b/code/forms/Users_RegisterForm.php @@ -32,6 +32,10 @@ class Users_RegisterForm extends Form { */ public function __construct($controller, $name) { + // If back URL set, push to session + if(isset($_REQUEST['BackURL'])) + Session::set('BackURL',$_REQUEST['BackURL']); + // Setup form fields $fields = new FieldList(); @@ -129,7 +133,6 @@ class Users_RegisterForm extends Form { // If a back URL is used in session. if(Session::get("BackURL")) { $redirect_url = Session::get("BackURL"); - Session::clear("BackURL"); } else { $redirect_url = Controller::join_links( BASE_URL,
Allow tracking of a back URL when a user completes the register form