diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/tile_generator/bosh.py b/tile_generator/bosh.py index <HASH>..<HASH> 100644 --- a/tile_generator/bosh.py +++ b/tile_generator/bosh.py @@ -76,9 +76,8 @@ class BoshRelease: return self.build_tarball() def download_tarball(self): - # TODO - Figure out why some releases aren't pulled from the cache mkdir_p(self.release_dir) - tarball = os.path.join(self.release_dir, self.name + '-boshrelease.tgz') + tarball = os.path.join(self.release_dir, self.name + '.tgz') download(self.path, tarball, self.context.get('cache', None)) manifest = self.get_manifest(tarball) self.tarball = os.path.join(self.release_dir, manifest['name'] + '-' + manifest['version'] + '.tgz')
Cleaned up path name to fix caching issue
diff --git a/lib/podio/areas/conversation.rb b/lib/podio/areas/conversation.rb index <HASH>..<HASH> 100644 --- a/lib/podio/areas/conversation.rb +++ b/lib/podio/areas/conversation.rb @@ -27,10 +27,10 @@ module Podio response.body end - def create_reply(conversation_id, text) + def create_reply(conversation_id, text, file_ids = []) response = Podio.connection.post do |req| req.url "/conversation/#{conversation_id}/reply" - req.body = { :text => text } + req.body = { :text => text, :file_ids => file_ids } end response.body['message_id'] end
Add file_ids support to conversation replies
diff --git a/asciimatics/widgets.py b/asciimatics/widgets.py index <HASH>..<HASH> 100644 --- a/asciimatics/widgets.py +++ b/asciimatics/widgets.py @@ -167,7 +167,8 @@ class Frame(Effect): within your Frame. """ - # Colour palette for the widgets within the Frame. + #: Colour palette for the widgets within the Frame. Each entry should be + #: a 3-tuple of (foreground colour, attribute, background colour). palette = { "background": (Screen.COLOUR_WHITE, Screen.A_NORMAL, Screen.COLOUR_BLUE),
Add palette to auto-generated docs
diff --git a/test/transform.js b/test/transform.js index <HASH>..<HASH> 100644 --- a/test/transform.js +++ b/test/transform.js @@ -53,8 +53,8 @@ describe('Transform stream', function () { t.on('end', function () { assert(gotBytes); - assert(gotBytes); - assert(gotBytes); + assert(gotPassthrough); + assert(gotData); done(); });
test: check all the variables in Transform test Before `gotBytes` was being checked 3 times in a row. Closes #1.
diff --git a/lib/helpers/sunomono_helpers.rb b/lib/helpers/sunomono_helpers.rb index <HASH>..<HASH> 100644 --- a/lib/helpers/sunomono_helpers.rb +++ b/lib/helpers/sunomono_helpers.rb @@ -149,7 +149,7 @@ end def framework_avaliable?(framework) if framework.downcase != 'calabash' && framework.downcase != 'appium' - puts 'Invalid framework choice calabash or appium' + puts "#{framework} is a invalid framework choice calabash or appium" exit 1 end end \ No newline at end of file diff --git a/lib/sunomono.rb b/lib/sunomono.rb index <HASH>..<HASH> 100644 --- a/lib/sunomono.rb +++ b/lib/sunomono.rb @@ -237,10 +237,7 @@ module Sunomono default: :en def new(platform, name) - if platform != 'calabash' && platform != 'appium' - puts "#{platform} is a invalid platform, please type calabash or appium" - exit 1 - end + framework_avaliable?(platform) I18n.config.default_locale = options[:lang] # Thor will be responsible to look for identical
Adjust on platform validation on command new project
diff --git a/lib/html-proofer/configuration.rb b/lib/html-proofer/configuration.rb index <HASH>..<HASH> 100644 --- a/lib/html-proofer/configuration.rb +++ b/lib/html-proofer/configuration.rb @@ -34,6 +34,7 @@ module HTMLProofer :headers => { 'User-Agent' => "Mozilla/5.0 (compatible; HTML Proofer/#{HTMLProofer::VERSION}; +https://github.com/gjtorikian/html-proofer)" } + :connecttimeout => 10 } HYDRA_DEFAULTS = {
Set Typhoeus connection timeout, fixes #<I>, #<I>
diff --git a/actionpack/lib/action_controller/test_process.rb b/actionpack/lib/action_controller/test_process.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_controller/test_process.rb +++ b/actionpack/lib/action_controller/test_process.rb @@ -110,6 +110,7 @@ module ActionController #:nodoc: end def recycle! + @env["action_controller.request.request_parameters"] = {} self.query_parameters = {} self.path_parameters = {} @headers, @request_method, @accepts, @content_type = nil, nil, nil, nil diff --git a/actionpack/test/controller/test_test.rb b/actionpack/test/controller/test_test.rb index <HASH>..<HASH> 100644 --- a/actionpack/test/controller/test_test.rb +++ b/actionpack/test/controller/test_test.rb @@ -515,6 +515,14 @@ XML assert_nil @request.instance_variable_get("@request_method") end + def test_params_reset_after_post_request + post :no_op, :foo => "bar" + assert_equal "bar", @request.params[:foo] + @request.recycle! + post :no_op + assert @request.params[:foo].blank? + end + %w(controller response request).each do |variable| %w(get post put delete head process).each do |method| define_method("test_#{variable}_missing_for_#{method}_raises_error") do
Reset request_parameters in TestRequest#recycle! to avoid multiple posts clobbering each other [#<I> state:resolved]
diff --git a/zhaquirks/xiaomi/__init__.py b/zhaquirks/xiaomi/__init__.py index <HASH>..<HASH> 100644 --- a/zhaquirks/xiaomi/__init__.py +++ b/zhaquirks/xiaomi/__init__.py @@ -186,8 +186,9 @@ class BasicCluster(CustomCluster, Basic): @staticmethod def _calculate_remaining_battery_percentage(voltage): """Calculate percentage.""" - min_voltage = 2500 - max_voltage = 3000 + # Min/Max values from https://github.com/louisZL/lumi-gateway-local-api + min_voltage = 2800 + max_voltage = 3300 percent = (voltage - min_voltage) / (max_voltage - min_voltage) * 200 return min(200, percent)
Fix Xiaomi sensors battery level (#<I>) * Fix Xiaomi sensors battery level According to <URL>
diff --git a/git.go b/git.go index <HASH>..<HASH> 100644 --- a/git.go +++ b/git.go @@ -10,6 +10,7 @@ import ( "bytes" "unsafe" "strings" + "fmt" ) const ( @@ -107,6 +108,9 @@ func (e GitError) Error() string{ func LastError() error { err := C.giterr_last() + if err == nil { + return &GitError{"No message", 0} + } return &GitError{C.GoString(err.message), int(err.klass)} }
Catch nil error instances Unfortunately libgit2 sometimes returns an error without setting an error message. Provide an alternative message instead of trying to dereference nil.
diff --git a/model/QtiJsonItemCompiler.php b/model/QtiJsonItemCompiler.php index <HASH>..<HASH> 100644 --- a/model/QtiJsonItemCompiler.php +++ b/model/QtiJsonItemCompiler.php @@ -88,7 +88,7 @@ class QtiJsonItemCompiler extends QtiItemCompiler $qtiItem = $this->retrieveAssets($item, $language, $publicDirectory); if (count($qtiItem->getBody()->getElements()) === 0) { - return new common_report_Report(common_report_Report::TYPE_ERROR, 'The item has an empty body.'); + //return new common_report_Report(common_report_Report::TYPE_ERROR, 'The item has an empty body.'); } $this->compileItemIndex($item->getUri(), $qtiItem, $language);
Removing empty item compilation failure as it is too much greedy.
diff --git a/airflow/contrib/hooks/gcp_dataflow_hook.py b/airflow/contrib/hooks/gcp_dataflow_hook.py index <HASH>..<HASH> 100644 --- a/airflow/contrib/hooks/gcp_dataflow_hook.py +++ b/airflow/contrib/hooks/gcp_dataflow_hook.py @@ -273,7 +273,7 @@ class DataFlowHook(GoogleCloudBaseHook): # https://cloud.google.com/dataflow/docs/reference/rest/v1b3/RuntimeEnvironment environment = {} for key in ['maxWorkers', 'zone', 'serviceAccountEmail', 'tempLocation', - 'bypassTempDirValidation', 'machineType']: + 'bypassTempDirValidation', 'machineType', 'network', 'subnetwork']: if key in variables: environment.update({key: variables[key]}) body = {"jobName": name,
[AIRFLOW-<I>] set network, subnetwork when launching dataflow template (#<I>)
diff --git a/src/lib/_partials/.meta.realm.js b/src/lib/_partials/.meta.realm.js index <HASH>..<HASH> 100644 --- a/src/lib/_partials/.meta.realm.js +++ b/src/lib/_partials/.meta.realm.js @@ -20,7 +20,7 @@ module.exports = exports = (kvp, options) => { } return { - key: kvp.key + ">main", + key: kvp.key, value: Object.assign(partial, raw) }; };
Removed 'main' partial dependency
diff --git a/tests/test_jwt.py b/tests/test_jwt.py index <HASH>..<HASH> 100644 --- a/tests/test_jwt.py +++ b/tests/test_jwt.py @@ -1,13 +1,13 @@ from __future__ import unicode_literals +import json +import sys +import time + from calendar import timegm from datetime import datetime from decimal import Decimal -import sys -import time -import json - import jwt if sys.version_info >= (2, 7): @@ -630,7 +630,7 @@ class TestJWT(unittest.TestCase): algorithm='ES384') with open('tests/testkey_ec.pub', 'r') as ec_pub_file: - pub_rsakey = ec_pub_file.read() + pub_eckey = ec_pub_file.read() assert jwt.decode(jwt_message, pub_eckey) load_output = jwt.load(jwt_message)
Fix test_encode_decode_with_ecdsa_sha<I> so that it actually uses the key its trying to use when using a SSH public key as a string argument to decode()
diff --git a/zipline/finance/performance.py b/zipline/finance/performance.py index <HASH>..<HASH> 100644 --- a/zipline/finance/performance.py +++ b/zipline/finance/performance.py @@ -166,15 +166,23 @@ class PerformanceTracker(): self.result_stream = None self.last_dict = None + # this performance period will span the entire simulation. self.cumulative_performance = PerformancePeriod( + # initial positions are empty {}, - self.capital_base, + # initial portfolio positions have zero value + 0, + # initial cash is your capital base. starting_cash = self.capital_base ) - + + # this performance period will span just the current market day self.todays_performance = PerformancePeriod( + # initial positions are empty {}, - self.capital_base, + # initial portfolio positions have zero value + 0, + # initial cash is your capital base. starting_cash = self.capital_base )
fixed bogus initial portfolio value (should be zero).
diff --git a/optlang/cplex_interface.py b/optlang/cplex_interface.py index <HASH>..<HASH> 100644 --- a/optlang/cplex_interface.py +++ b/optlang/cplex_interface.py @@ -93,7 +93,7 @@ _CPLEX_STATUS_TO_STATUS = { cplex.Cplex.solution.status.num_best: interface.NUMERIC, cplex.Cplex.solution.status.optimal: interface.OPTIMAL, cplex.Cplex.solution.status.optimal_face_unbounded: interface.SPECIAL, - cplex.Cplex.solution.status.optimal_infeasible: interface.SPECIAL, + cplex.Cplex.solution.status.optimal_infeasible: interface.INFEASIBLE, cplex.Cplex.solution.status.optimal_populated: interface.SPECIAL, cplex.Cplex.solution.status.optimal_populated_tolerance: interface.SPECIAL, cplex.Cplex.solution.status.optimal_relaxed_inf: interface.SPECIAL,
fix: treat "optimal_infeasible" as infeasible “optimal with unscaled infeasibilities” occurs when the scaled problem is solved within tolerance, but the optimal solution is outside the unscaled tolerance. This situation is now interpreted as infeasible.
diff --git a/omgeo/services/base.py b/omgeo/services/base.py index <HASH>..<HASH> 100644 --- a/omgeo/services/base.py +++ b/omgeo/services/base.py @@ -14,7 +14,8 @@ logger = logging.getLogger(__name__) class UpstreamResponseInfo(): """ Description of API call result from an upstream provider. - For cleaning and consistency, set attributes using the given methods. + For cleaning and consistency, set attributes using the given methods + (the constructor will automatically use these methods, as well). """ def set_response_code(self, response_code): @@ -63,6 +64,9 @@ class UpstreamResponseInfo(): self.set_success(success) self.errors = errors + def __repr__(self): + '%s %s %sms' % (self.geoservice, self.response_code, self.response_time) + class GeocodeService(): """
add repr method to geocoder info class
diff --git a/packages/angularjs-workorder/lib/workorder-list/workorder-list-controller.js b/packages/angularjs-workorder/lib/workorder-list/workorder-list-controller.js index <HASH>..<HASH> 100644 --- a/packages/angularjs-workorder/lib/workorder-list/workorder-list-controller.js +++ b/packages/angularjs-workorder/lib/workorder-list/workorder-list-controller.js @@ -43,7 +43,8 @@ function WorkorderListController($scope, workorderService, workorderFlowService, if (term.length > 3) { var filter = { - id: term + id: term, + title: term }; $q.resolve(workorderService.search(filter)).then(function(workorders) {
Filter also by title field in workorders in portal (#<I>)
diff --git a/mtools/test/test_mlaunch.py b/mtools/test/test_mlaunch.py index <HASH>..<HASH> 100644 --- a/mtools/test/test_mlaunch.py +++ b/mtools/test/test_mlaunch.py @@ -76,7 +76,7 @@ class TestMLaunch(object): if arg_str.startswith('init') or arg_str.startswith('--'): # add --port and --nojournal to init calls - arg_str += ' --port %i --nojournal' % self.port + arg_str += ' --port %i --nojournal --smallfiles' % self.port if self.use_auth: # add --auth to init calls if flag is set
removed --oplogSize from tests, config servers don't like it.
diff --git a/test/index.js b/test/index.js index <HASH>..<HASH> 100644 --- a/test/index.js +++ b/test/index.js @@ -1,4 +1,5 @@ var fs = require('fs'); +var jsesc = require('jsesc'); var parse = require('../parser').parse; @@ -32,7 +33,13 @@ parseTests.forEach(function(re, idx) { var resuls = parseResult[idx]; - if (JSON.stringify(par) !== JSON.stringify(resuls)) { + var stringify = function(obj) { + return jsesc(obj, { + json: true, compact: false, indent: ' ' + }); + } + + if (stringify(par) !== stringify(resuls)) { throw new Error('Failure parsing string ' + input + (flags ? '(' + flags + ')' : '') + ':' + JSON.stringify(par) + '\n' + JSON.stringify(resuls)); } else { console.log('PASSED TEST: ' + input);
Need to use jsesc in test/index.js as well
diff --git a/templates/forms/affiliation.php b/templates/forms/affiliation.php index <HASH>..<HASH> 100644 --- a/templates/forms/affiliation.php +++ b/templates/forms/affiliation.php @@ -221,8 +221,8 @@ <?php endif ?> </div> <div> - <input type="checkbox" name="terms" id="is_agree_check_box"> - <label for="terms">I agree to the <a href="<?php echo $affiliate_program_terms_url ?>" target="_blank" rel="noreferrer noopener">Referrer Program's</a> terms & conditions.</label> + <input type="checkbox" id="is_agree_check_box"> + <label for="is_agree_check_box">I agree to the <a href="<?php echo $affiliate_program_terms_url ?>" target="_blank" rel="noreferrer noopener">Referrer Program's</a> terms & conditions.</label> </div> </form> </div>
[affiliation-confirmation] [bug] [fix] Fixed a bug. The label's `for` attribute is expecting an ID not a name.
diff --git a/airflow/models.py b/airflow/models.py index <HASH>..<HASH> 100755 --- a/airflow/models.py +++ b/airflow/models.py @@ -1700,7 +1700,7 @@ class TaskInstance(Base, LoggingMixin): class VariableAccessor: """ Wrapper around Variable. This way you can get variables in templates by using - {var.variable_name}. + {var.value.your_variable_name}. """ def __init__(self): self.var = None @@ -1713,6 +1713,10 @@ class TaskInstance(Base, LoggingMixin): return str(self.var) class VariableJsonAccessor: + """ + Wrapper around deserialized Variables. This way you can get variables + in templates by using {var.json.your_variable_name}. + """ def __init__(self): self.var = None
[AIRFLOW-<I>] Elaborate on slightly ambiguous documentation Closes #<I> from AetherUnbound/bugfix/var-doc- reference
diff --git a/tests/aws/models/elb/model_tests.rb b/tests/aws/models/elb/model_tests.rb index <HASH>..<HASH> 100644 --- a/tests/aws/models/elb/model_tests.rb +++ b/tests/aws/models/elb/model_tests.rb @@ -110,6 +110,8 @@ Shindo.tests('AWS::ELB | models', ['aws', 'elb']) do end server = Fog::Compute[:aws].servers.create + server.wait_for { ready? } + tests('register instance') do begin elb.register_instances(server.id)
[aws|elb] wait_for server to be ready? before register
diff --git a/design/dsl/type.go b/design/dsl/type.go index <HASH>..<HASH> 100644 --- a/design/dsl/type.go +++ b/design/dsl/type.go @@ -61,6 +61,10 @@ func Type(name string, dsl func()) *design.UserTypeDefinition { // }) // Payload(ArrayOf(Bottle)) // Equivalent to Payload(Bottles) // }) +// +// If you are looking to return a collection of elements in a Response +// clause, refer to CollectionOf. ArrayOf creates a type, where +// CollectionOf creates a media type. func ArrayOf(t design.DataType) *design.Array { at := design.AttributeDefinition{Type: t} if ds, ok := t.(design.DataStructure); ok {
Added note to refer to CollectionOf, was looking for it.. and it's quite similar in concept to ArrayOf.
diff --git a/Security/OAuth/Exception/BadResponseException.php b/Security/OAuth/Exception/BadResponseException.php index <HASH>..<HASH> 100644 --- a/Security/OAuth/Exception/BadResponseException.php +++ b/Security/OAuth/Exception/BadResponseException.php @@ -31,7 +31,7 @@ class BadResponseException extends \LogicException $this->needClass = $needClass; $this->getClass = is_object($object) ? get_class($object) : 'not object'; - if ($needClass == null) { + if (empty($needClass)) { $this->needClass = DarvinAuthResponse::DARVIN_AUTH_RESPONSE_CLASS; }
Enhance bad response exception CS.
diff --git a/olctools/databasesetup/get_rmlst.py b/olctools/databasesetup/get_rmlst.py index <HASH>..<HASH> 100644 --- a/olctools/databasesetup/get_rmlst.py +++ b/olctools/databasesetup/get_rmlst.py @@ -51,7 +51,10 @@ class Get(object): # Remove and dashes or 'N's from the sequence data - makeblastdb can't handle sequences # with gaps # noinspection PyProtectedMember - record.seq._data = record.seq._data.replace('-', '').replace('N', '') + try: + record.seq._data = record.seq._data.replace('-', '').replace('N', '') + except TypeError: + record.seq._data = record.seq._data.replace(b'-', b'').replace(b'N', b'') # Clear the name and description attributes of the record record.name = '' record.description = ''
Added try/except if the sequence data is bytes-encoded
diff --git a/src/local/local.go b/src/local/local.go index <HASH>..<HASH> 100644 --- a/src/local/local.go +++ b/src/local/local.go @@ -1,11 +1,10 @@ package main import ( - "shadowsocks" - "net" - "bytes" - "log" "fmt" + "log" + "net" + "shadowsocks" ) func handleConnection(conn net.Conn, encryptTable, decryptTable []byte, server string) { @@ -39,9 +38,8 @@ func handleConnection(conn net.Conn, encryptTable, decryptTable []byte, server s addrToSend = buf[3:10] } else if addrType == 3 { addrLen := buf[4] - sb := bytes.NewBuffer(buf[5:5 + addrLen]) - addr = sb.String() - addrToSend = buf[3:5 + addrLen + 2] + addr = string(buf[5 : 5+addrLen]) + addrToSend = buf[3 : 5+addrLen+2] } else { hasError = true log.Println("unsurpported addr type")
Convert []byte to string directly.
diff --git a/test/unit/transforms/transformsFactory.test.js b/test/unit/transforms/transformsFactory.test.js index <HASH>..<HASH> 100644 --- a/test/unit/transforms/transformsFactory.test.js +++ b/test/unit/transforms/transformsFactory.test.js @@ -44,7 +44,6 @@ describe('transformsFactory', () => { test('createTransform should return CustomTransform', async () => { transformsFactory.addTransform('newType', (value) => { - console.log('payload', value); return (value || '').toUpperCase(); }); const transform = transformsFactory.createTransform({
- removed console :goose:
diff --git a/Kwc/Form/Component.js b/Kwc/Form/Component.js index <HASH>..<HASH> 100644 --- a/Kwc/Form/Component.js +++ b/Kwc/Form/Component.js @@ -209,7 +209,6 @@ Ext.extend(Kwc.Form.Component, Ext.util.Observable, { if (!hasErrors) { // Scroll to top of form scrollTo = this.el.getY(); - this.fireEvent('submitSuccess', this, r); } else { // Get position of first error field for(var fieldName in r.errorFields) {
Form: don't fire submitSuccess event twice
diff --git a/validator/sawtooth_validator/database/lmdb_nolock_database.py b/validator/sawtooth_validator/database/lmdb_nolock_database.py index <HASH>..<HASH> 100644 --- a/validator/sawtooth_validator/database/lmdb_nolock_database.py +++ b/validator/sawtooth_validator/database/lmdb_nolock_database.py @@ -50,6 +50,7 @@ class LMDBNoLockDatabase(database.Database): map_size=1024**4, map_async=True, writemap=True, + readahead=False, subdir=False, create=create, lock=True)
Disable LMDB read ahead caching for LMDBNoLockDatabase
diff --git a/lib/how_is/report.rb b/lib/how_is/report.rb index <HASH>..<HASH> 100644 --- a/lib/how_is/report.rb +++ b/lib/how_is/report.rb @@ -4,7 +4,7 @@ require 'date' require "pathname" class HowIs - # Error class + # Raised when attempting to export to an unsupported format class UnsupportedExportFormat < StandardError def initialize(format) super("Unsupported export format: #{format}")
[docs] Improve docblock wording
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ classifiers = ["License :: OSI Approved :: Apache Software License", "Operating System :: Microsoft :: Windows", "Operating System :: MacOS :: MacOS X"] + [ ("Programming Language :: Python :: %s" % x) for x in - "2.7 3.4".split()] + "2.7 3.4 3.5".split()] def make_cmdline_entry_points():
Tested in python <I>
diff --git a/LeanMapper/Repository.php b/LeanMapper/Repository.php index <HASH>..<HASH> 100644 --- a/LeanMapper/Repository.php +++ b/LeanMapper/Repository.php @@ -268,12 +268,7 @@ abstract class Repository return $this->entityClass = $entityClass; } } - $entityClass = $this->mapper->getEntityClass($this->mapper->getTableByRepositoryClass(get_called_class()), $row); - if ($row === null) { // this allows small performance optimalization (TODO: note in documentation) - $this->entityClass = $entityClass; - } else { - return $entityClass; - } + return $this->mapper->getEntityClass($this->mapper->getTableByRepositoryClass(get_called_class()), $row); } return $this->entityClass; }
Fixed cache-related issue in Repository
diff --git a/generators/app/index.js b/generators/app/index.js index <HASH>..<HASH> 100644 --- a/generators/app/index.js +++ b/generators/app/index.js @@ -106,7 +106,7 @@ module.exports = generator.extend({ this.template('dummy.txt', 'dummy.txt'); try { - jhipsterFunc.registerModule('generator-jhipster-db-helper', 'entity', 'post', 'app', 'A JHipster module for already existing databases'); + jhipsterFunc.registerModule('generator-jhipster-db-helper', 'app', 'post', 'app', 'A JHipster module for already existing databases'); } catch (err) { this.log(`${chalk.red.bold('WARN!')} Could not register as a jhipster entity post creation hook...\n`); }
move hook to post app rather than post entity
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -46,9 +46,16 @@ if os.name == 'nt': # Hack to overcome a separate bug def get_command_class(self, command): - """Ensures self.cmdclass is not a tuple.""" - if type(self.cmdclass) is tuple: - self.cmdclass = list(self.cmdclass) + """Replacement that doesn't write to self.cmdclass.""" + if command in self.cmdclass: + return self.cmdclass[command] + + for ep in pkg_resources.iter_entry_points('distutils.commands',command): + ep.require(installer=self.fetch_build_egg) + return ep.load() + else: + return _Distribution.get_command_class(self, command) + return dist.Distribution._get_command_class(self, command) dist.Distribution._get_command_class = dist.Distribution.get_command_class dist.Distribution.get_command_class = get_command_class
Another try for Win <I>.
diff --git a/lib/omni_kassa.rb b/lib/omni_kassa.rb index <HASH>..<HASH> 100644 --- a/lib/omni_kassa.rb +++ b/lib/omni_kassa.rb @@ -3,7 +3,7 @@ require 'active_support/core_ext/string' module OmniKassa REQUEST_SETTINGS = :merchant_id, :currency_code, :transaction_reference, - :customer_language + :customer_language, :key_version SETTINGS = REQUEST_SETTINGS + [:secret_key, :url] def self.config(settings)
Added key_version to REQUEST_SETTINGS
diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index <HASH>..<HASH> 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -30,11 +30,6 @@ var astTransformVisitor = { delete node.argument; } - if (t.isClassProperty(node)) { - // eslint doesn't like these - this.remove(); - } - if (t.isImportBatchSpecifier(node)) { // ImportBatchSpecifier<name> => ImportNamespaceSpecifier<id> node.type = "ImportNamespaceSpecifier"; @@ -42,6 +37,19 @@ var astTransformVisitor = { delete node.name; } + // classes + + if (t.isClassDeclaration(node)) { + return t.variableDeclaration("let", [ + t.variableDeclarator(node.id, node) + ]); + } + + if (t.isClassProperty(node)) { + // eslint doesn't like these + this.remove(); + } + // JSX if (t.isJSXIdentifier(node)) {
turn class declarations into variable declarations - fixes babel/babel-eslint#8
diff --git a/lib/iniparse/line_types.rb b/lib/iniparse/line_types.rb index <HASH>..<HASH> 100644 --- a/lib/iniparse/line_types.rb +++ b/lib/iniparse/line_types.rb @@ -8,8 +8,7 @@ module IniParse :comment => nil, :comment_sep => nil, :comment_offset => 0, - :indent => nil, - :line => nil + :indent => nil }.freeze # Holds options for this line.
Let's not pass around a :line option for now.
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -296,7 +296,7 @@ function DiscordClient(options) { } }); } else { - console.log("Error POSTing login information: " + res.statusMessage + "\n" + body); + console.log("Error POSTing login information: \n" + body); self.emit("disconnected"); return false; }
Doesn't seem to give a statusMessage.
diff --git a/pyecore/ecore.py b/pyecore/ecore.py index <HASH>..<HASH> 100644 --- a/pyecore/ecore.py +++ b/pyecore/ecore.py @@ -61,12 +61,13 @@ class EcoreUtils(object): hasattr(obj, '_staticEClass') and obj._staticEClass elif isinstance(_type, EEnum): return obj in _type - elif isinstance(_type, EDataType) or isinstance(_type, EAttribute): + elif isinstance(_type, (EDataType, EAttribute)): return isinstance(obj, _type.eType) elif isinstance(_type, EClass): if isinstance(obj, EObject): - return obj.eClass is _type \ - or _type in obj.eClass.eAllSuperTypes() + return isinstance(obj, _type.python_class) + # return obj.eClass is _type \ + # or _type in obj.eClass.eAllSuperTypes() return False return isinstance(obj, _type) or obj is _type.eClass
Change 'EcoreUtils.isinstance' to deal with Python class This modification avoids the PyEcore 'isinstance' algorithm to deal with 'eAllSuperTypes()' which could be time consumming. Instead, it uses the 'python_class' which is produced and add to each 'EClass' instance.
diff --git a/spec/acceptance/real_time_updates_spec.rb b/spec/acceptance/real_time_updates_spec.rb index <HASH>..<HASH> 100644 --- a/spec/acceptance/real_time_updates_spec.rb +++ b/spec/acceptance/real_time_updates_spec.rb @@ -5,7 +5,7 @@ describe 'Updates to records in real-time indices', :live => true do product = Product.create! :name => "Widget \u0000" expect(Product.search.first).to eq(product) - end + end unless ENV['DATABASE'] == 'postgresql' it "handles attributes for sortable fields accordingly" do product = Product.create! :name => 'Red Fish'
Disable null character check for PostgreSQL. Seems pg updates don't allow such strings in the database. Fine by me.
diff --git a/lib/lago/__init__.py b/lib/lago/__init__.py index <HASH>..<HASH> 100644 --- a/lib/lago/__init__.py +++ b/lib/lago/__init__.py @@ -504,11 +504,18 @@ class Prefix(object): task_message = 'Create empty disk image' elif spec['type'] == 'file': url = spec.get('url', '') + path = spec.get('path', '') + + if not url and not path: + raise RuntimeError('Partial drive spec %s' % str(spec)) + if url: - shutil.move( - self.fetch_url(self.path.prefixed(url)), spec['path'] - ) - # If we're using raw file, just return it's path + disk_in_prefix = self.fetch_url(url) + if path: + shutil.move(disk_in_prefix, spec['path']) + else: + spec['path'] = disk_in_prefix + # If we're using raw file, return it's path return spec['path'], disk_metadata else: raise RuntimeError('Unknown drive spec %s' % str(spec))
Support storing of disk url's into given path Allow when given both url and path to store the disk in given path Both url and uri are part of the disk json spec Change-Id: I5ec<I>d4ab<I>d1ce<I>bf<I>aa<I>b<I>c<I>aee
diff --git a/modules/core/src/life_cycle/life_cycle.js b/modules/core/src/life_cycle/life_cycle.js index <HASH>..<HASH> 100644 --- a/modules/core/src/life_cycle/life_cycle.js +++ b/modules/core/src/life_cycle/life_cycle.js @@ -1,13 +1,22 @@ import {FIELD} from 'facade/lang'; import {ChangeDetector} from 'change_detection/change_detector'; +import {VmTurnZone} from 'core/zone/vm_turn_zone'; export class LifeCycle { _changeDetector:ChangeDetector; - constructor() { - this._changeDetector = null; + + constructor(changeDetector:ChangeDetector) { + this._changeDetector = changeDetector; + } + + registerWith(zone:VmTurnZone) { + zone.initCallbacks({ + onTurnDone: () => this.tick() + }); + this.tick(); } - digest() { - _changeDetector.detectChanges(); + tick() { + this._changeDetector.detectChanges(); } } \ No newline at end of file
feat(LifeCycle): change LifeCycle to be able register it with a zone
diff --git a/src/ODM/MongoDB/Types/CurrencyType.php b/src/ODM/MongoDB/Types/CurrencyType.php index <HASH>..<HASH> 100644 --- a/src/ODM/MongoDB/Types/CurrencyType.php +++ b/src/ODM/MongoDB/Types/CurrencyType.php @@ -2,10 +2,10 @@ namespace ZFBrasil\DoctrineMoneyModule\ODM\MongoDB\Types; -use Doctrine\ODM\MongoDB\Types\StringType; +use Doctrine\ODM\MongoDB\Types\Type; use Money\Currency; -class CurrencyType extends StringType +class CurrencyType extends Type { const NAME = 'currency'; @@ -22,4 +22,20 @@ class CurrencyType extends StringType return new Currency($value); } + + public function closureToMongo() + { + return ' + if ($value) { + $return = $value->getName(); + } else { + $return null; + } + '; + } + + public function closureToPHP() + { + return '$return = new \Money\Currency($value);'; + } }
Bug fixation of ODM\MongoDB\Types\CurrencyType * shouldn't use stringtype
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -50,6 +50,7 @@ setup( long_description = long_description, keywords = 'framework templating template html xhtml python html5', + python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', classifiers = [ 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)',
Add python_requires to help pip
diff --git a/lib/traject/horizon_reader.rb b/lib/traject/horizon_reader.rb index <HASH>..<HASH> 100644 --- a/lib/traject/horizon_reader.rb +++ b/lib/traject/horizon_reader.rb @@ -356,6 +356,7 @@ module Traject rescue Exception => e logger.fatal "HorizonReader, unexpected exception at bib id:#{current_bib_id}: #{e}" + raise e ensure logger.info("HorizonReader: Closing all JDBC objects...")
bah, def do need to re-raise caught exception
diff --git a/container/lxc/lxc.go b/container/lxc/lxc.go index <HASH>..<HASH> 100644 --- a/container/lxc/lxc.go +++ b/container/lxc/lxc.go @@ -148,14 +148,13 @@ lxc.network.type = veth lxc.network.link = lxcbr0 lxc.network.flags = up -lxc.mount.entry=/var/log/juju %s none defaults,bind 0 0 +lxc.mount.entry=/var/log/juju var/log/juju none defaults,bind 0 0 ` func (lxc *lxcContainer) WriteConfig() (string, error) { // TODO(thumper): support different network settings. - config := fmt.Sprintf(localConfig, lxc.InternalLogDir()) configFilename := filepath.Join(lxc.Directory(), "lxc.conf") - if err := ioutil.WriteFile(configFilename, []byte(config), 0644); err != nil { + if err := ioutil.WriteFile(configFilename, []byte(localConfig), 0644); err != nil { return "", err } return configFilename, nil
Have the config file use the root relative path for the mount.
diff --git a/src/ReadModel/Index/Projector.php b/src/ReadModel/Index/Projector.php index <HASH>..<HASH> 100644 --- a/src/ReadModel/Index/Projector.php +++ b/src/ReadModel/Index/Projector.php @@ -326,8 +326,8 @@ class Projector implements EventListenerInterface $eventId, EntityType::EVENT(), $userId, - null, - null, + '', + '', $this->localDomain, $creationDate ); diff --git a/test/ReadModel/Index/ProjectorTest.php b/test/ReadModel/Index/ProjectorTest.php index <HASH>..<HASH> 100644 --- a/test/ReadModel/Index/ProjectorTest.php +++ b/test/ReadModel/Index/ProjectorTest.php @@ -224,8 +224,8 @@ class ProjectorTest extends \PHPUnit_Framework_TestCase $eventId, EntityType::EVENT(), $userId, - null, - null, + '', + '', Domain::specifyType('omd.be'), $this->isInstanceOf(\DateTime::class) );
III-<I> Title and zip should be set to default empty string instead of null.
diff --git a/src/cbednarski/Pharcc/Compiler.php b/src/cbednarski/Pharcc/Compiler.php index <HASH>..<HASH> 100644 --- a/src/cbednarski/Pharcc/Compiler.php +++ b/src/cbednarski/Pharcc/Compiler.php @@ -112,7 +112,7 @@ HEREDOC; } elseif (is_dir($include)) { $files = array_merge($files, FileUtils::listFilesInDir($this->config->getBasePath().DIRECTORY_SEPARATOR.$include)); } else { - throw new Exception('Included path is missing, unreadable, or is not a file or directory' . $include); + throw new \Exception('Included path is missing, unreadable, or is not a file or directory' . $include); } }
Added backslash to get Exception from the global namespace
diff --git a/jupyterdrive/gdrive/drive-contents.js b/jupyterdrive/gdrive/drive-contents.js index <HASH>..<HASH> 100644 --- a/jupyterdrive/gdrive/drive-contents.js +++ b/jupyterdrive/gdrive/drive-contents.js @@ -105,7 +105,10 @@ define(function(require) { }; Contents.prototype.delete = function(path) { - return drive_utils.get_id_for_path(path, drive_utils.FileType.FILE) + return gapi_utils.gapi_ready + .then(function() { + return drive_utils.get_id_for_path(path, drive_utils.FileType.FILE); + }) .then(function(file_id){ return gapi_utils.execute(gapi.client.drive.files.delete({'fileId': file_id})); });
Adds gapi_utils.gapi_ready guard to Contents.delete gapi_utils.gapi_ready is a promise that is fullfilled when the Google API has loaded. This promise should be used to guard any calls to gapi_util or drive_util functions, to prevent calls to the Google API before the API has loaded.
diff --git a/simulation.py b/simulation.py index <HASH>..<HASH> 100644 --- a/simulation.py +++ b/simulation.py @@ -47,6 +47,14 @@ class _DataFrameWrapper(object): return list(self._frame.columns) + _list_columns_for_table(self.name) @property + def local_columns(self): + """ + Columns in this table. + + """ + return list(self._frame.columns) + + @property def index(self): """ Table index.
when adding rows, need to be able to get only the local columns
diff --git a/test/run-tests.php b/test/run-tests.php index <HASH>..<HASH> 100644 --- a/test/run-tests.php +++ b/test/run-tests.php @@ -24,7 +24,7 @@ /* $Id$ */ -error_reporting(E_ALL &~E_DEPRECATED); +error_reporting(E_ALL); if (!file_exists(dirname(__FILE__) . '/config.local.php')) { echo "Create config.local.php";
Removed E_DEPRECATED
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -363,7 +363,7 @@ setup( # 'ITER': ['*.csv'], # }, package_data={ - "tofu.tests.tests01_geom.tests03core_data": ["*.py", "*.txt"], + "tofu.tests.tests01_geom.tests03_core_data": ["*.py", "*.txt"], "tofu.geom.inputs": ["*.txt"], }, include_package_data=True,
Corrected typo in package_data that prevented proper .txt data to be included in sdist package from tests<I>_geom/tests<I>_core_data/
diff --git a/spring-cloud-contract-verifier/src/main/java/org/springframework/cloud/contract/verifier/messaging/camel/CamelStubMessages.java b/spring-cloud-contract-verifier/src/main/java/org/springframework/cloud/contract/verifier/messaging/camel/CamelStubMessages.java index <HASH>..<HASH> 100644 --- a/spring-cloud-contract-verifier/src/main/java/org/springframework/cloud/contract/verifier/messaging/camel/CamelStubMessages.java +++ b/spring-cloud-contract-verifier/src/main/java/org/springframework/cloud/contract/verifier/messaging/camel/CamelStubMessages.java @@ -76,7 +76,7 @@ public class CamelStubMessages implements MessageVerifier<Message> { ConsumerTemplate consumerTemplate = this.context.createConsumerTemplate(); Exchange exchange = consumerTemplate.receive(destination, timeUnit.toMillis(timeout)); - return exchange.getIn(); + return exchange != null ? exchange.getIn() : null; } catch (Exception e) { log.error("Exception occurred while trying to read a message from "
Added npe guard; fixes gh-<I>
diff --git a/src/oauth2server/DatabaseInterface.php b/src/oauth2server/DatabaseInterface.php index <HASH>..<HASH> 100644 --- a/src/oauth2server/DatabaseInterface.php +++ b/src/oauth2server/DatabaseInterface.php @@ -6,8 +6,8 @@ interface DatabaseInteface { public function validateClient( $clientId, - $clientSecret, - $redirectUri + $clientSecret = null, + $redirectUri = null ); public function newSession(
Added NULL default back to $clientSecret and $redirectUri
diff --git a/MAVProxy/modules/lib/ntrip.py b/MAVProxy/modules/lib/ntrip.py index <HASH>..<HASH> 100755 --- a/MAVProxy/modules/lib/ntrip.py +++ b/MAVProxy/modules/lib/ntrip.py @@ -175,6 +175,10 @@ class NtripClient(object): self.socket.close() self.socket = None return None + if len(data) == 0: + self.socket.close() + self.socket = None + return None if self.rtcm3.read(data): self.last_id = self.rtcm3.get_packet_ID() return self.rtcm3.get_packet()
ntrip: cope with zero data return
diff --git a/lib/server.js b/lib/server.js index <HASH>..<HASH> 100644 --- a/lib/server.js +++ b/lib/server.js @@ -20,7 +20,7 @@ function Server(host, port) { // if host provided, augment the urlObj if (host) { - urlObj.host = host; + urlObj.hostname = host; } // if port provided, augment the urlObj
Small bugfix of setting the server hostname.
diff --git a/redisson/src/test/java/org/redisson/executor/RedissonScheduledExecutorServiceTest.java b/redisson/src/test/java/org/redisson/executor/RedissonScheduledExecutorServiceTest.java index <HASH>..<HASH> 100644 --- a/redisson/src/test/java/org/redisson/executor/RedissonScheduledExecutorServiceTest.java +++ b/redisson/src/test/java/org/redisson/executor/RedissonScheduledExecutorServiceTest.java @@ -173,6 +173,17 @@ public class RedissonScheduledExecutorServiceTest extends BaseTest { Thread.sleep(3000); assertThat(redisson.getAtomicLong("counter").get()).isEqualTo(3); + redisson.getAtomicLong("counter").delete(); + + RScheduledFuture<?> future2 = executor.scheduleWithFixedDelay(new ScheduledLongRepeatableTask("counter", "executed2"), 1, 2, TimeUnit.SECONDS); + Thread.sleep(6000); + assertThat(redisson.getAtomicLong("counter").get()).isEqualTo(3); + + executor.cancelTask(future2.getTaskId()); + assertThat(redisson.<Long>getBucket("executed2").get()).isBetween(1000L, Long.MAX_VALUE); + + Thread.sleep(3000); + assertThat(redisson.getAtomicLong("counter").get()).isEqualTo(3); } private void cancel(ScheduledFuture<?> future1) throws InterruptedException, ExecutionException {
test for cancelTask method added
diff --git a/spec/scss_lint/linter/private_naming_convention_spec.rb b/spec/scss_lint/linter/private_naming_convention_spec.rb index <HASH>..<HASH> 100644 --- a/spec/scss_lint/linter/private_naming_convention_spec.rb +++ b/spec/scss_lint/linter/private_naming_convention_spec.rb @@ -60,6 +60,20 @@ describe SCSSLint::Linter::PrivateNamingConvention do it { should_not report_lint } end + context 'is defined and used in the same file that starts with an @import' do + let(:scss) { <<-SCSS } + @import 'bar'; + + $_foo: red; + + p { + color: $_foo; + } + SCSS + + it { should_not report_lint } + end + context 'is defined and used in a for loop when the file begins with a comment' do let(:scss) { <<-SCSS } // A comment
Add test for another edge case in PrivateNamingConvention I was trying out this new rule in a few more places, and noticed similarly broken behavior when the file starts with an @import statement. My previous fix also resolves this, but I think it is good to cover this with a test anyway.
diff --git a/lib/AmazonMwsResource.js b/lib/AmazonMwsResource.js index <HASH>..<HASH> 100644 --- a/lib/AmazonMwsResource.js +++ b/lib/AmazonMwsResource.js @@ -151,7 +151,15 @@ AmazonMwsResource.prototype = { function parseCSVFile(res, responseString, delimiter, callback) { var data = []; - csv.fromString(responseString, {headers: true, delimiter: delimiter, ignoreEmpty: true, quote: null}) + var options = { + delimiter: delimiter, + headers: true, + discardUnmappedColumns: true, + quote: null, + ignoreEmpty: true, + trim: true + }; + csv.fromString(responseString, options) .on('data', function (value) { data.push(value); })
added more options for CSV parsing
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -87,6 +87,10 @@ function WebTorrent (opts) { self.emit('error', err) self.destroy() }) + + // Ignore warning when there are > 10 torrents in the client + self.dht.setMaxListeners(0) + self.dht.listen(opts.dhtPort) } else { self.dht = false
Ignore warning when there are > <I> torrents in the client
diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -402,7 +402,7 @@ abstract class Kernel implements KernelInterface } if ($this->container->hasParameter('kernel.compiled_classes')) { - ClassCollectionLoader::load($this->container->getParameter('kernel.compiled_classes'), $this->getCacheDir(), $name, $this->debug, true, $extension); + ClassCollectionLoader::load($this->container->getParameter('kernel.compiled_classes'), $this->getCacheDir(), $name, $this->debug, false, $extension); } }
[HttpKernel] changed the compiled class cache to non-adaptative (as it is now loaded very early)
diff --git a/lib/bowline/library.rb b/lib/bowline/library.rb index <HASH>..<HASH> 100644 --- a/lib/bowline/library.rb +++ b/lib/bowline/library.rb @@ -5,9 +5,8 @@ module Bowline RUBYLIB_URL = "#{PROJECT_URL}/rubylib.zip" def path - # TODO - tilda won't work on win32 File.expand_path( - File.join(*%w{~ .bowline}) + File.join(Gem.user_home, ".bowline") ) end module_function :path
Gem lib has a nice api for the user's home dir
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -49,23 +49,23 @@ var lowerBound = exports.lowerBound = function (range) { return k && range[k] } -exports.lowerBoundInclusive = function (range) { +var lowerBoundInclusive = exports.lowerBoundInclusive = function (range) { return has(range, 'gt') ? false : true } -exports.upperBoundInclusive = +var upperBoundInclusive = exports.upperBoundInclusive = function (range) { - return has(range, 'lt') || !range.minEx ? false : true + return (has(range, 'lt') /*&& !range.maxEx*/) ? false : true } var lowerBoundExclusive = exports.lowerBoundExclusive = function (range) { - return has(range, 'gt') || range.minEx ? true : false + return !lowerBoundInclusive(range) } var upperBoundExclusive = exports.upperBoundExclusive = function (range) { - return has(range, 'lt') ? true : false + return !upperBoundInclusive(range) } var upperBoundKey = exports.upperBoundKey = function (range) { @@ -144,3 +144,8 @@ exports.filter = function (range, compare) { return exports.contains(range, key, compare) } } + + + + +
_Exclusive interms of _Inclusive
diff --git a/orangepi/pi4B.py b/orangepi/pi4B.py index <HASH>..<HASH> 100644 --- a/orangepi/pi4B.py +++ b/orangepi/pi4B.py @@ -18,10 +18,10 @@ Usage: # pin number = (position of letter in alphabet - 1) * 32 + pin number # So, PD14 will be (4 - 1) * 32 + 14 = 110 -import orangepi.4 +import orangepi.pi4 # Orange Pi One physical board pin to GPIO pin -BOARD = orangepi.4.BOARD +BOARD = orangepi.pi4.BOARD # Orange Pi One BCM pin to actual GPIO pin -BCM = orangepi.4.BCM +BCM = orangepi.pi4.BCM
Update pi4B.py (#<I>) correct ref to pi4
diff --git a/tornado/concurrent.py b/tornado/concurrent.py index <HASH>..<HASH> 100644 --- a/tornado/concurrent.py +++ b/tornado/concurrent.py @@ -156,6 +156,7 @@ def return_future(f): return True exc_info = None with ExceptionStackContext(handle_error): + result = None try: result = f(*args, **kwargs) except:
Ensure the result variable is initialized even when an exception is handled.
diff --git a/client/js/uploader.js b/client/js/uploader.js index <HASH>..<HASH> 100644 --- a/client/js/uploader.js +++ b/client/js/uploader.js @@ -338,6 +338,7 @@ qq.extend(qq.FineUploader.prototype, { var item = this.getItemByFileId(id); this._find(item, 'progressBar').style.width = 0; qq(item).removeClass(this._classes.fail); + qq(this._find(item, 'statusText')).clearText(); this._showSpinner(item); this._showCancelLink(item); return true;
#<I> - hide "failure" status message after starting retry attempt
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ setup( author_email='nico.schloemer@gmail.com', requires=['matplotlib (>=1.4.0)', 'numpy'], description='convert matplotlib figures into TikZ/PGFPlots', - long_description=convert_to_rst('README.md'), + long_description=convert_to_rst(os.path.abspath('README.md')), license='MIT License', classifiers=[ 'Development Status :: 5 - Production/Stable',
setup: always get README.md
diff --git a/lib/omnibus-ctl.rb b/lib/omnibus-ctl.rb index <HASH>..<HASH> 100644 --- a/lib/omnibus-ctl.rb +++ b/lib/omnibus-ctl.rb @@ -354,6 +354,11 @@ module Omnibus end end + # If it begins with a '-', it is an option. + def is_option?(arg) + arg && arg[0] == '-' + end + def run(args) # Ensure Omnibus related binaries are in the PATH ENV["PATH"] = [File.join(base_path, "bin"), @@ -361,8 +366,21 @@ module Omnibus ENV['PATH']].join(":") command_to_run = args[0] - service = args[1] + + # This piece of code checks if the argument is an option. If it is, + # then it sets service to nil and adds the argument into the options + # argument. This is ugly. A better solution is having a proper parser. + # But if we are going to implement a proper parser, we might as well + # port this to Thor rather than reinventing Thor. For now, this preserves + # the behavior to complain and exit with an error if one attempts to invoke + # a pcc command that does not accept an argument. Like "help". options = args[2..-1] || [] + if is_option?(args[1]) + options.unshift(args[1]) + service = nil + else + service = args[1] + end if !command_map.has_key?(command_to_run) log "I don't know that command."
Check if service argument is actually an option
diff --git a/tests/Pheasant/Tests/MysqlTestCase.php b/tests/Pheasant/Tests/MysqlTestCase.php index <HASH>..<HASH> 100755 --- a/tests/Pheasant/Tests/MysqlTestCase.php +++ b/tests/Pheasant/Tests/MysqlTestCase.php @@ -19,6 +19,11 @@ class MysqlTestCase extends \PHPUnit_Framework_TestCase ; } + public function tearDown() + { + $this->pheasant->connection()->close(); + } + // Helper to return a connection public function connection() {
Close connection in test cases to avoid running out of connections
diff --git a/js/bones.js b/js/bones.js index <HASH>..<HASH> 100644 --- a/js/bones.js +++ b/js/bones.js @@ -638,7 +638,7 @@ var bones = { exports.Td = bones.Td; exports.Form = bones.Form; exports.Input = bones.Input; - exports.TextArea = bones.TextArea; + exports.Textarea = bones.Textarea; exports.Select = bones.Select; exports.Option = bones.Option; exports.Label = bones.Label;
merged cloud9 version with github version. Fixed bug in export of Textarea.
diff --git a/lib/json-dry.js b/lib/json-dry.js index <HASH>..<HASH> 100644 --- a/lib/json-dry.js +++ b/lib/json-dry.js @@ -14,7 +14,7 @@ var special_char = '~', * * @author Jelle De Loecker <jelle@develry.be> * @since 0.1.0 - * @version 1.0.0 + * @version 1.0.1 * * @param {Object} root * @param {Function} replacer @@ -131,7 +131,7 @@ function createDryReplacer(root, replacer) { // See if the new path is shorter len = 1; for (i = 0; i < path.length; i++) { - len += 1 + path.length; + len += 1 + path[i].length; } len += key.length;
Fix calculating length of possible replacement path
diff --git a/aomi/validation.py b/aomi/validation.py index <HASH>..<HASH> 100644 --- a/aomi/validation.py +++ b/aomi/validation.py @@ -1,6 +1,7 @@ """Some validation helpers for aomi""" from __future__ import print_function import os +import platform import stat from aomi.helpers import problems, abspath, is_tagged, log @@ -66,10 +67,11 @@ def secret_file(filename): stat.S_ISLNK(filestat.st_mode) == 0: problems("Secret file %s must be a real file or symlink" % filename) - if filestat.st_mode & stat.S_IROTH or \ - filestat.st_mode & stat.S_IWOTH or \ - filestat.st_mode & stat.S_IWGRP: - problems("Secret file %s has too loose permissions" % filename) + if (platform.system() != "Windows"): + if filestat.st_mode & stat.S_IROTH or \ + filestat.st_mode & stat.S_IWOTH or \ + filestat.st_mode & stat.S_IWGRP: + problems("Secret file %s has too loose permissions" % filename) def validate_obj(keys, obj):
Don't do the file permission check on Windows When running Python on Windows, most of the file system permission checks are ignored by the python stat() call. So don't do the fine-grained permission checks there. Correct (hopefully) the whitespace issue More whitespace tinkering
diff --git a/question/upgrade.php b/question/upgrade.php index <HASH>..<HASH> 100644 --- a/question/upgrade.php +++ b/question/upgrade.php @@ -77,8 +77,9 @@ function question_remove_rqp_qtype_config_string() { */ function question_random_check($result){ global $CFG; - if ($CFG->version >= 2007081000){ - return null;//no test after upgrade seperates question cats into contexts. + if (!empty($CFG->running_installer) //no test on first installation, no questions to test yet + || $CFG->version >= 2007081000){//no test after upgrade seperates question cats into contexts. + return null; } if (!$toupdate = question_cwqpfs_to_update()){ $result->setStatus(true);//pass test
MDL-<I> custom check was causing error on installation because dmllib functions are not available yet.
diff --git a/group/classes/output/user_groups_editable.php b/group/classes/output/user_groups_editable.php index <HASH>..<HASH> 100644 --- a/group/classes/output/user_groups_editable.php +++ b/group/classes/output/user_groups_editable.php @@ -75,7 +75,7 @@ class user_groups_editable extends \core\output\inplace_editable { $options = []; foreach ($coursegroups as $group) { - $options[$group->id] = $group->name; + $options[$group->id] = format_string($group->name, true, ['context' => $this->context]); } $this->edithint = get_string('editusersgroupsa', 'group', fullname($user)); $this->editlabel = get_string('editusersgroupsa', 'group', fullname($user));
MDL-<I> core_group: add support for multi-lang to groups editable Part of MDL-<I>.
diff --git a/packages/graphics/src/Graphics.js b/packages/graphics/src/Graphics.js index <HASH>..<HASH> 100644 --- a/packages/graphics/src/Graphics.js +++ b/packages/graphics/src/Graphics.js @@ -527,7 +527,18 @@ export default class Graphics extends Container if (points) { - if (points[points.length - 2] !== startX || points[points.length - 1] !== startY) + // TODO: make a better fix. + + // We check how far our start is from the last existing point + const xDiff = Math.abs(points[points.length - 2] - startX); + const yDiff = Math.abs(points[points.length - 1] - startY); + + if (xDiff < 0.001 && yDiff < 0.001) + { + // If the point is very close, we don't add it, since this would lead to artifacts + // during tessellation due to floating point imprecision. + } + else { points.push(startX, startY); }
Fixes arc duplicating points (#<I>)
diff --git a/config/common.php b/config/common.php index <HASH>..<HASH> 100644 --- a/config/common.php +++ b/config/common.php @@ -1,7 +1,9 @@ <?php return [ + \Psr\SimpleCache\CacheInterface::class => \yii\di\Reference::to('cache'), + \yii\cache\CacheInterface::class => \yii\di\Reference::to('cache'), 'cache' => [ - '__class' => yii\cache\Cache::class, + '__class' => \yii\cache\Cache::class, ], ];
Added DI config for cache interfaces
diff --git a/test/async.es6.js b/test/async.es6.js index <HASH>..<HASH> 100644 --- a/test/async.es6.js +++ b/test/async.es6.js @@ -226,6 +226,22 @@ describe("async functions and await expressions", function() { done(); }).catch(done); }); + + it("should propagate failure when returned", function() { + var rejection = new Error("rejection"); + + async function f() { + return new Promise(function(resolve, reject) { + reject(rejection); + }); + } + + return f().then(function(result) { + assert.ok(false, "should have been rejected"); + }, function(error) { + assert.strictEqual(error, rejection); + }); + }); }); describe("async function expressions", function() {
Add a failing test for #<I>.
diff --git a/src/product-helpers.js b/src/product-helpers.js index <HASH>..<HASH> 100644 --- a/src/product-helpers.js +++ b/src/product-helpers.js @@ -7,7 +7,7 @@ export default { * Returns the variant of a product corresponding to the options given. * * @example - * const selectedVariant = client.product.variantForOptions(product, { + * const selectedVariant = client.product.helpers.variantForOptions(product, { * size: "Small", * color: "Red" * });
Add correct documentation for variantForOptions from product helpers
diff --git a/lib/are_you_sure/form_builders/confirm_form_builder.rb b/lib/are_you_sure/form_builders/confirm_form_builder.rb index <HASH>..<HASH> 100644 --- a/lib/are_you_sure/form_builders/confirm_form_builder.rb +++ b/lib/are_you_sure/form_builders/confirm_form_builder.rb @@ -63,7 +63,7 @@ module AreYouSure end def select_field_value(selected, *options) - return '' unless selected + return '' if selected.nil? options.flatten.each_slice(2).to_a.detect {|i| i[1] == selected }[0] end
selected is false or nil?
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -15,8 +15,9 @@ setup( author_email='venthur@debian.org', url='https://github.com/venthur/python-debianbts', license='GPL2', - package_dir = {'': 'src'}, - py_modules = ['debianbts'], + package_dir={'': 'src'}, + py_modules=['debianbts'], + install_requires=['pysimplesoap'], classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", diff --git a/src/debianbts.py b/src/debianbts.py index <HASH>..<HASH> 100644 --- a/src/debianbts.py +++ b/src/debianbts.py @@ -48,7 +48,7 @@ if os.path.isdir(ca_path): # MAJOR: incompatible API changes # MINOR: add backwards-comptible functionality # PATCH: backwards-compatible bug fixes. -__version__ = '2.6.0' +__version__ = '2.6.1' PY2 = sys.version_info.major == 2
Adding pysimplesoap to install requirements and bumping version.
diff --git a/src/Baum/Extensions/ModelExtensions.php b/src/Baum/Extensions/ModelExtensions.php index <HASH>..<HASH> 100644 --- a/src/Baum/Extensions/ModelExtensions.php +++ b/src/Baum/Extensions/ModelExtensions.php @@ -9,16 +9,13 @@ trait ModelExtensions { * @return \Baum\Node */ public function reload() { - if ( !$this->exists ) - return $this; + if ( !$this->exists ) { + $this->syncOriginal(); + } else { + $fresh = static::find($this->getKey()); - $dirty = $this->getDirty(); - if ( count($dirty) === 0 ) - return $this; - - $fresh = static::find($this->getKey()); - - $this->setRawAttributes($fresh->getAttributes(), true); + $this->setRawAttributes($fresh->getAttributes(), true); + } return $this; }
Modify Model::reload() function behaviour to sync with original attributes when model is not persisted and to always load from the database otherwise.
diff --git a/restcomm/restcomm.rvd/src/main/webapp/js/app/controllers/designer.js b/restcomm/restcomm.rvd/src/main/webapp/js/app/controllers/designer.js index <HASH>..<HASH> 100644 --- a/restcomm/restcomm.rvd/src/main/webapp/js/app/controllers/designer.js +++ b/restcomm/restcomm.rvd/src/main/webapp/js/app/controllers/designer.js @@ -300,12 +300,14 @@ var designerCtrl = App.controller('designerCtrl', function($scope, $q, $routePar .then( function () { return designerService.buildProject($scope.projectName) } ) .then( function () { - $scope.drawGraph(); + if ($scope.showGraph) + $scope.drawGraph(); notifications.put({type:"success", message:"Project saved"}); console.log("Project saved and built"); }, function (reason) { - $scope.drawGraph(); + if ($scope.showGraph) + $scope.drawGraph(); if ( reason.exception.className == 'ValidationException' ) { console.log("Validation error"); notifications.put({type:"warning", message:"Project saved with validation errors"});
Fixed regression issue observed when saving projects with diagram hidden. Refers #<I>
diff --git a/playground/examples/creating.objects.js b/playground/examples/creating.objects.js index <HASH>..<HASH> 100644 --- a/playground/examples/creating.objects.js +++ b/playground/examples/creating.objects.js @@ -73,14 +73,14 @@ syn.note( 0 ) // We can pass our own property values to // constructors. For example: -syn = Synth({ octave:-2, waveform:'pwm', Q:.9 }) +syn = Synth({ octave:-2, Q:.9, decay:1 }) syn.note( 0 ) // really, the above is just a shorthand for: syn = Synth() syn.octave = -2 -syn.waveform = 'pwm' syn.Q = .9 +syn.decay = 1 syn.note( 0 ) // We can also pass a preset first, and then
fixing intro tutorial to not change waveform property after init
diff --git a/mautrix/client/api/modules/media_repository.py b/mautrix/client/api/modules/media_repository.py index <HASH>..<HASH> 100644 --- a/mautrix/client/api/modules/media_repository.py +++ b/mautrix/client/api/modules/media_repository.py @@ -47,7 +47,7 @@ class MediaRepositoryMethods(BaseClientAPI): Raises: MatrixResponseError: If the response does not contain a ``content_uri`` field. """ - resp = await self.api.request(Method.PUT, MediaPath.unstable["fi.mau.msc2246"].create) + resp = await self.api.request(Method.POST, MediaPath.unstable["fi.mau.msc2246"].create) try: return resp["content_uri"] except KeyError:
async media: fix method on /create
diff --git a/src/DataTables/Backend/CategoriesDataTable.php b/src/DataTables/Backend/CategoriesDataTable.php index <HASH>..<HASH> 100644 --- a/src/DataTables/Backend/CategoriesDataTable.php +++ b/src/DataTables/Backend/CategoriesDataTable.php @@ -4,7 +4,6 @@ declare(strict_types=1); namespace Cortex\Categorizable\DataTables\Backend; -use Cortex\Categorizable\Models\Category; use Cortex\Foundation\DataTables\AbstractDataTable; use Cortex\Categorizable\Transformers\Backend\CategoryTransformer; @@ -13,7 +12,7 @@ class CategoriesDataTable extends AbstractDataTable /** * {@inheritdoc} */ - protected $model = Category::class; + protected $model = 'rinvex.categorizable.category'; /** * {@inheritdoc}
Use IoC bound model instead of the explicitly hardcoded
diff --git a/liquibase-core/src/main/java/liquibase/database/core/DerbyDatabase.java b/liquibase-core/src/main/java/liquibase/database/core/DerbyDatabase.java index <HASH>..<HASH> 100644 --- a/liquibase-core/src/main/java/liquibase/database/core/DerbyDatabase.java +++ b/liquibase-core/src/main/java/liquibase/database/core/DerbyDatabase.java @@ -31,7 +31,10 @@ public class DerbyDatabase extends AbstractDatabase { } public String getDefaultDriver(String url) { - if (url.startsWith("jdbc:derby")) { + // CORE-1230 - don't shutdown derby network server + if (url.startsWith("jdbc:derby://")) { + return "org.apache.derby.jdbc.ClientDriver"; + } else if (url.startsWith("java:derby")) { return "org.apache.derby.jdbc.EmbeddedDriver"; } return null;
fix CORE-<I> shutdown derby database depends on whether it is embedded or network server
diff --git a/tests/framework/helpers/MarkdownTest.php b/tests/framework/helpers/MarkdownTest.php index <HASH>..<HASH> 100644 --- a/tests/framework/helpers/MarkdownTest.php +++ b/tests/framework/helpers/MarkdownTest.php @@ -36,4 +36,20 @@ TEXT; $this->assertNotEquals(Markdown::process($text), Markdown::process($text, 'original')); $this->assertEquals(Markdown::process($text), Markdown::process($text, 'gfm-comment')); } + + /** + * @expectedException \yii\base\InvalidParamException + * @expectedExceptionMessage Markdown flavor 'undefined' is not defined. + */ + public function testProcessInvalidParamException() + { + Markdown::process('foo', 'undefined'); + } + + public function testProcessParagraph() + { + $actual = Markdown::processParagraph('foo'); + $expected = 'foo'; + $this->assertEquals($expected, $actual); + } }
Add test coverage of yii\helpers\BaseMarkdown (#<I>)
diff --git a/lago/templates.py b/lago/templates.py index <HASH>..<HASH> 100644 --- a/lago/templates.py +++ b/lago/templates.py @@ -228,7 +228,7 @@ class HttpTemplateProvider: """ response = self.open_url(url=handle, suffix='.hash') try: - return response.read() + return response.read().decode('utf-8') finally: response.close()
py3: templates: Decode downloaded hash to string
diff --git a/lastfp/__init__.py b/lastfp/__init__.py index <HASH>..<HASH> 100644 --- a/lastfp/__init__.py +++ b/lastfp/__init__.py @@ -116,6 +116,8 @@ def fpid_query(duration, fpdata, metadata=None): raise CommunicationError('ID query failed') except httplib.BadStatusLine: raise CommunicationError('bad response in ID query') + except IOError: + raise CommunicationError('ID query failed') try: fpid, status = res.split()[:2] @@ -146,6 +148,8 @@ def metadata_query(fpid, apikey): raise CommunicationError('metadata query failed') except httplib.BadStatusLine: raise CommunicationError('bad response in metadata query') + except IOError: + raise CommunicationError('metadata query failed') return fh.read() class ExtractionError(FingerprintError):
yet another HTTP failure more: raising IOError
diff --git a/src/com/opera/core/systems/OperaDriver.java b/src/com/opera/core/systems/OperaDriver.java index <HASH>..<HASH> 100644 --- a/src/com/opera/core/systems/OperaDriver.java +++ b/src/com/opera/core/systems/OperaDriver.java @@ -210,6 +210,12 @@ public class OperaDriver extends RemoteWebDriver implements TakesScreenshot { // Get product from Opera settings.setProduct(utils().getProduct()); + + // Mobile needs to be able to autofocus elements for form input currently. This is an ugly + // workaround which should get solved by implementing a standalone bream Scope service. + if (utils().getProduct().is(OperaProduct.MOBILE)) { + preferences().set("User Prefs", "Allow Autofocus Form Element", true); + } } /**
Workaround for letting Opera Mobile autofocus form elements through ECMAscript
diff --git a/lib/rake/builder/qt_builder.rb b/lib/rake/builder/qt_builder.rb index <HASH>..<HASH> 100644 --- a/lib/rake/builder/qt_builder.rb +++ b/lib/rake/builder/qt_builder.rb @@ -33,9 +33,10 @@ module Rake end def configure - super + raise 'programming_language must be C++' if @programming_language.downcase != 'c++' + raise 'qt_version must be set' if ! @qt_version - raise "qt_version must be set" if ! @qt_version + super @resource_files = Rake::Path.expand_all_with_root( @resource_files, @rakefile_path ) @compilation_options += [ '-pipe', '-g', '-gdwarf-2', '-Wall', '-W' ]
Ensure that programming language is C++
diff --git a/NavigationReactNative/src/android/src/main/java/com/navigation/reactnative/TabLayoutView.java b/NavigationReactNative/src/android/src/main/java/com/navigation/reactnative/TabLayoutView.java index <HASH>..<HASH> 100644 --- a/NavigationReactNative/src/android/src/main/java/com/navigation/reactnative/TabLayoutView.java +++ b/NavigationReactNative/src/android/src/main/java/com/navigation/reactnative/TabLayoutView.java @@ -69,9 +69,11 @@ public class TabLayoutView extends TabLayout implements TabView { @Override public void onTabReselected(Tab tab) { - View tabBarItem = ((TabBarView) viewPager).getTabAt(0); - if (tabBarItem instanceof ScrollView) - ((ScrollView) tabBarItem).smoothScrollTo(0,0); + if (viewPager != null) { + View tabBarItem = ((TabBarView) viewPager).getTabAt(0); + if (tabBarItem instanceof ScrollView) + ((ScrollView) tabBarItem).smoothScrollTo(0, 0); + } } }; addOnTabSelectedListener(tabSelectedListener);
Checked view pager is not null
diff --git a/Test/Fixture/SerializableAssocFixture.php b/Test/Fixture/SerializableAssocFixture.php index <HASH>..<HASH> 100644 --- a/Test/Fixture/SerializableAssocFixture.php +++ b/Test/Fixture/SerializableAssocFixture.php @@ -36,7 +36,7 @@ class SerializableAssocFixture extends CakeTestFixture { */ public $fields = array( 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 20, 'key' => 'primary'), - 'field3' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 100000, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), + 'field3' => array('type' => 'text', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 'serializable_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 20), 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') );
fix fixture for mysql <I>
diff --git a/tasks/update.php b/tasks/update.php index <HASH>..<HASH> 100644 --- a/tasks/update.php +++ b/tasks/update.php @@ -99,7 +99,7 @@ class Fluxbb_Update_Task protected function down_version($version) { - $this->log('Rollback to v'.$version.'...'); + $this->log('Rollback from v'.$version.'...'); $this->foreach_migration($version, 'down'); }
Small wording fix in update task.
diff --git a/lib/octopress-deploy/s3.rb b/lib/octopress-deploy/s3.rb index <HASH>..<HASH> 100644 --- a/lib/octopress-deploy/s3.rb +++ b/lib/octopress-deploy/s3.rb @@ -30,7 +30,7 @@ module Octopress #abort "Seriously, you should. Quitting..." unless Deploy.check_gitignore @bucket = @s3.buckets[@bucket_name] if !@bucket.exists? - abort "Bucket not found: '#{@bucket_name}'. Check your configuration or create a bucket using: `octopress deploy add_bucket`" + abort "Bucket not found: '#{@bucket_name}'. Check your configuration or create a bucket using: `octopress deploy add-bucket`" else puts "Syncing #{@local} files to #{@bucket_name} on S3." write_files @@ -42,7 +42,7 @@ module Octopress def pull @bucket = @s3.buckets[@bucket_name] if !@bucket.exists? - abort "Bucket not found: '#{@bucket_name}'. Check your configuration or create a bucket using: `octopress deploy add_bucket`" + abort "Bucket not found: '#{@bucket_name}'. Check your configuration or create a bucket using: `octopress deploy add-bucket`" else puts "Syncing #{@bucket_name} files to #{@pull_dir} on S3." @bucket.objects.each do |object|
Fixed wrong command name for add-bucket
diff --git a/elizabeth/core/providers.py b/elizabeth/core/providers.py index <HASH>..<HASH> 100644 --- a/elizabeth/core/providers.py +++ b/elizabeth/core/providers.py @@ -2656,8 +2656,11 @@ class Generic(object): self.path = Path() def __getattr__(self, attrname): - """Get _attribute witout underscore""" - + """Get _attribute without underscore + + :param attrname: Attribute name. + :return: An attribute. + """ attribute = object.__getattribute__(self, '_' + attrname) if attribute and callable(attribute): attribute = attribute(self.locale)
Updated comments of __getattribute__
diff --git a/service/security/hapi-auth-service.js b/service/security/hapi-auth-service.js index <HASH>..<HASH> 100644 --- a/service/security/hapi-auth-service.js +++ b/service/security/hapi-auth-service.js @@ -2,6 +2,7 @@ const Boom = require('boom') const Hoek = require('hoek') +const config = require('./../lib/config') const internals = {} @@ -51,7 +52,7 @@ internals.implementation = function (server, options) { // only allow the SuperAdmin to impersonate an org let organizationId = user.organizationId - if (organizationId === 'ROOT' && request.headers.org) { + if (organizationId === config.get('authorization.superUser.organization.id') && request.headers.org) { organizationId = request.headers.org }
Fixes hard coded ROOT organization id
diff --git a/packages/tiptap-extensions/src/marks/Link.js b/packages/tiptap-extensions/src/marks/Link.js index <HASH>..<HASH> 100644 --- a/packages/tiptap-extensions/src/marks/Link.js +++ b/packages/tiptap-extensions/src/marks/Link.js @@ -59,7 +59,7 @@ export default class Link extends Mark { const { schema } = view.state const attrs = getMarkAttrs(view.state, schema.marks.link) - if (attrs.href) { + if (attrs.href && event.target instanceof HTMLAnchorElement) { event.stopPropagation() window.open(attrs.href) }
fix #<I>: link click handler no longer open on selection click
diff --git a/src/main/java/com/xtremelabs/robolectric/shadows/ShadowCanvas.java b/src/main/java/com/xtremelabs/robolectric/shadows/ShadowCanvas.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/xtremelabs/robolectric/shadows/ShadowCanvas.java +++ b/src/main/java/com/xtremelabs/robolectric/shadows/ShadowCanvas.java @@ -96,11 +96,16 @@ public class ShadowCanvas { public void drawBitmap(Bitmap bitmap, Rect src, Rect dst, Paint paint) { describeBitmap(bitmap, paint); - appendDescription(" at (" + - dst.left + "," + dst.top + - ") with height=" + dst.height() + - " and width=" + dst.width() + - " taken from " + src.toString()); + StringBuilder descriptionBuilder = new StringBuilder(); + if (dst != null) { + descriptionBuilder.append(" at (").append(dst.left).append(",").append(dst.top) + .append(") with height=").append(dst.height()).append(" and width=").append(dst.width()); + } + + if (src != null) { + descriptionBuilder.append( " taken from ").append(src.toString()); + } + appendDescription(descriptionBuilder.toString()); } @Implementation
Check for null before logging in ShadowCanvas. (src is allowed to be null)
diff --git a/lib/rvideo/inspector.rb b/lib/rvideo/inspector.rb index <HASH>..<HASH> 100644 --- a/lib/rvideo/inspector.rb +++ b/lib/rvideo/inspector.rb @@ -50,7 +50,7 @@ module RVideo # :nodoc: raise ArgumentError, "Must supply either an input file or a pregenerated response" if options[:raw_response].nil? and file.nil? end - metadata = /(Input \#.*)\nMust/m.match(@raw_response) + metadata = metadata_match if /Unknown format/i.match(@raw_response) || metadata.nil? @unknown_format = true @@ -515,6 +515,18 @@ module RVideo # :nodoc: end private + + def metadata_match + [ + /(Input \#.*)\nMust/m, # ffmpeg + /(Input \#.*)\nAt least/m # ffmpeg macports + ].each do |rgx| + if md=rgx.match(@raw_response) + return md + end + end + nil + end def bitrate_match /bitrate: ([0-9\.]+)\s*(.*)\s+/.match(@raw_metadata)
Updated inspector to support ffmpeg output from the macports ffmpeg.