diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/lib/Packager/lib/process-assets-stream/process-assets-stream.js b/lib/Packager/lib/process-assets-stream/process-assets-stream.js
index <HASH>..<HASH> 100644
--- a/lib/Packager/lib/process-assets-stream/process-assets-stream.js
+++ b/lib/Packager/lib/process-assets-stream/process-assets-stream.js
@@ -147,11 +147,13 @@ proto.resolveBundleAssets = function (bundle) {
return entry.assets && entry.assets.length;
}).forEach(function (entry) {
entry.assets.forEach(function (file) {
+ var out = outfileSource(file, entry, opts, true);
+ out = out.replace(/\.\.\//g, '');
assets.push({
source: file,
outfile: path.join(
opts.outDir,
- outfileSource(file, entry, opts, true)
+ out
),
copy: true,
mtime: entry.mtime[file] | ENYO-<I>: Asset deployment encounters incorrect destination locations with absolute paths |
diff --git a/tests/test-timber-site.php b/tests/test-timber-site.php
index <HASH>..<HASH> 100644
--- a/tests/test-timber-site.php
+++ b/tests/test-timber-site.php
@@ -9,6 +9,12 @@ class TestTimberSite extends Timber_UnitTestCase {
$this->assertEquals( $content_subdir.'/themes/twentyfifteen', $site->theme->path );
}
+ function testLanguageAttributes() {
+ $site = new TimberSite();
+ $lang = $site->language_attributes();
+ $this->assertEquals('lang="en-US"', $lang);
+ }
+
function testChildParentThemeLocation() {
TestTimberLoader::_setupChildTheme();
$content_subdir = Timber\URLHelper::get_content_subdir(); | Test to cover Site::language_attributes(); |
diff --git a/lib/simple_form/action_view_extensions/form_helper.rb b/lib/simple_form/action_view_extensions/form_helper.rb
index <HASH>..<HASH> 100644
--- a/lib/simple_form/action_view_extensions/form_helper.rb
+++ b/lib/simple_form/action_view_extensions/form_helper.rb
@@ -60,7 +60,7 @@ module SimpleForm
elsif record.is_a?(String) || record.is_a?(Symbol)
as || record
else
- record = record.last if record.is_a?(Array)
+ record = record.last if record.respond_to?(:last)
action = record.respond_to?(:persisted?) && record.persisted? ? :edit : :new
as ? "#{action}_#{as}" : dom_class(record, action)
end | let's check for responding to :last method instead of checking class |
diff --git a/ast.go b/ast.go
index <HASH>..<HASH> 100644
--- a/ast.go
+++ b/ast.go
@@ -1117,10 +1117,15 @@ func (s *SelectStatement) validateAggregates(tr targetRequirement) error {
return fmt.Errorf("invalid number of arguments for %s, expected at least %d, got %d", c.Name, exp, got)
}
if len(c.Args) > 1 {
- _, ok := c.Args[len(c.Args)-1].(*NumberLiteral)
+ callLimit, ok := c.Args[len(c.Args)-1].(*NumberLiteral)
if !ok {
return fmt.Errorf("expected integer as last argument in %s(), found %s", c.Name, c.Args[len(c.Args)-1])
}
+ // Check if they asked for a limit smaller than what they passed into the call
+ if int64(callLimit.Val) > int64(s.Limit) && s.Limit != 0 {
+ return fmt.Errorf("limit (%d) in %s function can not be larger than the LIMIT (%d) in the select statement", int64(callLimit.Val), c.Name, int64(s.Limit))
+ }
+
for _, v := range c.Args[:len(c.Args)-1] {
if _, ok := v.(*VarRef); !ok {
return fmt.Errorf("only fields or tags are allowed in %s(), found %s", c.Name, v) | wire up advanced top sorting/slicing |
diff --git a/packages/material-ui/src/index.js b/packages/material-ui/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/material-ui/src/index.js
+++ b/packages/material-ui/src/index.js
@@ -3,6 +3,7 @@ import * as colors from './colors';
export { colors };
export {
createMuiTheme,
+ createStyles,
makeStyles,
MuiThemeProvider,
styled, | [core] Fix createStyles not being defined (#<I>) |
diff --git a/lib/generators/para/admin_user/admin_user_generator.rb b/lib/generators/para/admin_user/admin_user_generator.rb
index <HASH>..<HASH> 100644
--- a/lib/generators/para/admin_user/admin_user_generator.rb
+++ b/lib/generators/para/admin_user/admin_user_generator.rb
@@ -6,7 +6,8 @@ module Para
say 'Creating default admin...'
email = ask('Email [admin@example.com] : ').presence || 'admin@example.com'
- password = ask('Password [password] : ').presence || 'password'
+ password = ask('Password [password] : ', echo: false).presence || 'password'
+ print "\n" # echo: false doesn't print a newline so we manually add it
AdminUser.create! email: email, password: password | do not echo on password typing in para:admin_user rake task |
diff --git a/tests/Unit/Suites/Context/Website/ConfigurableUrlToWebsiteMapTest.php b/tests/Unit/Suites/Context/Website/ConfigurableUrlToWebsiteMapTest.php
index <HASH>..<HASH> 100644
--- a/tests/Unit/Suites/Context/Website/ConfigurableUrlToWebsiteMapTest.php
+++ b/tests/Unit/Suites/Context/Website/ConfigurableUrlToWebsiteMapTest.php
@@ -109,7 +109,7 @@ class ConfigurableUrlToWebsiteMapTest extends TestCase
$this->assertSame('foo', $websiteMap->getRequestPathWithoutWebsitePrefix('http://example.com/foo'));
}
- public function testRturnsTheRequestPathWithoutUrlPrefixWithoutQueryArguments()
+ public function testReturnsTheRequestPathWithoutUrlPrefixWithoutQueryArguments()
{
$testMap = 'http://example.com/aa/=foo|http://example.com/=bar';
$this->stubConfigReader->method('get')->with(ConfigurableUrlToWebsiteMap::CONFIG_KEY)->willReturn($testMap); | Issue #<I>: Fix typo in test method name |
diff --git a/dddp/accounts/ddp.py b/dddp/accounts/ddp.py
index <HASH>..<HASH> 100644
--- a/dddp/accounts/ddp.py
+++ b/dddp/accounts/ddp.py
@@ -442,10 +442,10 @@ class Auth(APIMixin):
)
@api_endpoint('resetPassword')
- def reset_password(self, params):
+ def reset_password(self, token, new_password):
"""Reset password using a token received in email then logs user in."""
- user, _ = self.validated_user_and_session(params['token'])
- user.set_password(params['newPassword'])
+ user, _ = self.validated_user_and_session(token)
+ user.set_password(new_password)
user.save()
auth.login(this.request, user)
self.update_subs(user.pk) | fix incorrect params in reset_password |
diff --git a/Str.php b/Str.php
index <HASH>..<HASH> 100644
--- a/Str.php
+++ b/Str.php
@@ -2,7 +2,6 @@
namespace Illuminate\Support;
-use Illuminate\Support\Arr;
use Illuminate\Support\Traits\Macroable;
use League\CommonMark\GithubFlavoredMarkdownConverter;
use Ramsey\Uuid\Codec\TimestampFirstCombCodec; | Apply fixes from StyleCI (#<I>) |
diff --git a/lib/manamana.rb b/lib/manamana.rb
index <HASH>..<HASH> 100644
--- a/lib/manamana.rb
+++ b/lib/manamana.rb
@@ -1,3 +1,6 @@
-require "manamana/version"
-require "manamana/rdsl/parser"
-require "manamana/tdsl/parser"
\ No newline at end of file
+require 'manamana/version'
+require 'manamana/rdsl/parser'
+require 'manamana/tdsl/parser'
+require 'manamana/steps'
+require 'manamana/compiler'
+require 'manamana/runner'
\ No newline at end of file | Update manamana main rb |
diff --git a/molgenis-omx-protocolviewer/src/main/java/org/molgenis/omx/plugins/ProtocolViewerController.java b/molgenis-omx-protocolviewer/src/main/java/org/molgenis/omx/plugins/ProtocolViewerController.java
index <HASH>..<HASH> 100644
--- a/molgenis-omx-protocolviewer/src/main/java/org/molgenis/omx/plugins/ProtocolViewerController.java
+++ b/molgenis-omx-protocolviewer/src/main/java/org/molgenis/omx/plugins/ProtocolViewerController.java
@@ -580,7 +580,12 @@ public class ProtocolViewerController extends PluginModel<Entity>
{
this.id = feature.getId();
this.name = feature.getName();
- this.i18nDescription = new Gson().fromJson(feature.getDescription(), new TypeToken<Map<String, String>>()
+ String description = feature.getDescription();
+ if (description != null && (!description.startsWith("{") || !description.endsWith("}")))
+ {
+ description = " {\"en\":\"" + description + "\"}";
+ }
+ this.i18nDescription = new Gson().fromJson(description, new TypeToken<Map<String, String>>()
{
}.getType());
this.dataType = feature.getDataType(); | fixed the Json in the description field in ObservableFeature |
diff --git a/nodeshot/core/nodes/admin.py b/nodeshot/core/nodes/admin.py
index <HASH>..<HASH> 100755
--- a/nodeshot/core/nodes/admin.py
+++ b/nodeshot/core/nodes/admin.py
@@ -32,7 +32,7 @@ class ImageInline(BaseStackedInline):
classes = ('grp-collapse grp-open', )
-NODE_FILTERS = ['is_published', 'status', 'access_level', 'added']
+NODE_FILTERS = ['is_published', 'status', 'access_level', 'added', 'updated']
NODE_LIST_DISPLAY = ['name', 'user', 'status', 'access_level', 'is_published', 'added', 'updated']
NODE_FIELDS_LOOKEDUP = [
'user__id', 'user__username', | filter by updated date in node admin |
diff --git a/cruddy/calculatedvalue.py b/cruddy/calculatedvalue.py
index <HASH>..<HASH> 100644
--- a/cruddy/calculatedvalue.py
+++ b/cruddy/calculatedvalue.py
@@ -16,6 +16,8 @@ import re
import uuid
import time
+from botocore.vendored.six import string_types
+
class CalculatedValue(object):
@@ -24,7 +26,7 @@ class CalculatedValue(object):
@classmethod
def check(cls, token):
- if isinstance(token, str):
+ if isinstance(token, string_types):
match = cls.token_re.match(token)
if match:
operation = match.group('operation') | Fix check for string type to use six string_types |
diff --git a/lib/beaker-pe/version.rb b/lib/beaker-pe/version.rb
index <HASH>..<HASH> 100644
--- a/lib/beaker-pe/version.rb
+++ b/lib/beaker-pe/version.rb
@@ -3,7 +3,7 @@ module Beaker
module PE
module Version
- STRING = '1.39.0'
+ STRING = '1.40.0'
end
end | (GEM) update beaker-pe version to <I> |
diff --git a/libraries/lithium/data/model/RecordSet.php b/libraries/lithium/data/model/RecordSet.php
index <HASH>..<HASH> 100644
--- a/libraries/lithium/data/model/RecordSet.php
+++ b/libraries/lithium/data/model/RecordSet.php
@@ -254,7 +254,7 @@ class RecordSet extends \lithium\util\Collection {
return $result;
}
- public function __desctruct() {
+ public function __destruct() {
$this->_close();
} | Fixing typo in `RecordSet` re: ticket #6. Thanks 'oh4real'. |
diff --git a/neutronclient/tests/unit/test_cli20.py b/neutronclient/tests/unit/test_cli20.py
index <HASH>..<HASH> 100644
--- a/neutronclient/tests/unit/test_cli20.py
+++ b/neutronclient/tests/unit/test_cli20.py
@@ -182,9 +182,6 @@ class CLITestV20Base(base.BaseTestCase):
cmd_resource=None, parent_id=None):
return name_or_id
- def _get_attr_metadata(self):
- return self.metadata
-
def setUp(self, plurals=None):
"""Prepare the test environment."""
super(CLITestV20Base, self).setUp()
@@ -202,9 +199,6 @@ class CLITestV20Base(base.BaseTestCase):
self.useFixture(fixtures.MonkeyPatch(
'neutronclient.neutron.v2_0.find_resourceid_by_id',
self._find_resourceid))
- self.useFixture(fixtures.MonkeyPatch(
- 'neutronclient.v2_0.client.Client.get_attr_metadata',
- self._get_attr_metadata))
self.client = client.Client(token=TOKEN, endpoint_url=self.endurl)
self.client.format = self.format | tests: removed mocking for Client.get_attr_metadata
The method is not present since XML support removal:
I<I>b0fdd<I>a<I>d5ff<I>a<I>e<I>df5b1
Change-Id: Iaa<I>a1e9bd<I>b<I>ed6f4f5a4d1da<I>aac<I>d<I>
Related-Bug: #<I> |
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -5,7 +5,7 @@ module.exports = function(source) {
this.cacheable(true);
var callback = this.async();
- var config = loaderUtils.getOptions(this);
+ var config = loaderUtils.getOptions(this) || {};
// This piece of code exists in order to support webpack 1.x.x top level configurations.
// In webpack 2 this options does not exists anymore. | Support missing configs (#1) (#<I>)
* Support missing configs (#1)
* Support missing configs
`loaderUtils.getOptions(this)` will return `null` if no parseable structure is found. We don't currently `null` check this when reading `useConfig`.
I have added a default empty object as a fallback for this scenario.
* Patch version @<I>
* Reset semver |
diff --git a/gui/test_riabdock.py b/gui/test_riabdock.py
index <HASH>..<HASH> 100644
--- a/gui/test_riabdock.py
+++ b/gui/test_riabdock.py
@@ -648,7 +648,7 @@ class RiabDockTest(unittest.TestCase):
#Terdampak (x 1000): 2366
assert '2366' in myResult, myMessage
- def Xtest_issue45(self):
+ def test_issue45(self):
"""Points near the edge of a raster hazard layer are interpolated OK"""
clearmyDock()
@@ -685,9 +685,9 @@ class RiabDockTest(unittest.TestCase):
myMessage = 'Got unexpected state: %s' % str(myDict)
assert myDict == expectDict, myMessage
- # This is the where nosetest hangs when running the
+ # This is the where nosetest sometims hangs when running the
# guitest suite (Issue #103)
- # The QTest.mouseClick call never returns.
+ # The QTest.mouseClick call never returns when run with nosetest, but OK when run normally.
QTest.mouseClick(myButton, QtCore.Qt.LeftButton)
myResult = DOCK.wvResults.page().currentFrame().toPlainText() | Re-enabled test_issue<I> that used to hang (issue #<I>). It works now. Why? |
diff --git a/lib/vagrant/machine_index/remote.rb b/lib/vagrant/machine_index/remote.rb
index <HASH>..<HASH> 100644
--- a/lib/vagrant/machine_index/remote.rb
+++ b/lib/vagrant/machine_index/remote.rb
@@ -7,8 +7,8 @@ module Vagrant
name: machine.name,
local_data_path: machine.project.local_data_path,
provider: machine.provider_name,
- full_state: machine.state,
- state: machine.state.id,
+ full_state: machine.machine_state,
+ state: machine.machine_state.id,
vagrantfile_name: machine.project.vagrantfile_name,
vagrantfile_path: machine.project.vagrantfile_path,
})
@@ -86,7 +86,7 @@ module Vagrant
def each(reload=true, &block)
if reload
client.all.each do |m|
- @machines[m.uuid] = m
+ @machines[m.id] = m
end
end | Fix method calls when building entry and setting ID |
diff --git a/streams/streams.go b/streams/streams.go
index <HASH>..<HASH> 100644
--- a/streams/streams.go
+++ b/streams/streams.go
@@ -46,10 +46,10 @@ import (
// Subreddits returns a stream of new posts from the requested subreddits. This
// stream monitors the combination listing of all subreddits using Reddit's "+"
// feature e.g. /r/golang+rust. This will consume one interval of the handle per
-// call, so it is best to gather all the subreddits needed and make invoke this
+// call, so it is best to gather all the subreddits needed and invoke this
// function once.
//
-// Be aware that these posts are unlikely to have comments. If you are
+// Be aware that these posts are new and will not have comments. If you are
// interested in comment trees, save their permalinks and fetch them later.
func Subreddits(
scanner reddit.Scanner,
@@ -69,11 +69,11 @@ func Subreddits(
// subreddits. This stream monitors the combination listing of all subreddits
// using Reddit's "+" feature e.g. /r/golang+rust. This will consume one
// interval of the handle per call, so it is best to gather all the subreddits
-// needed and make invoke this function once.
+// needed and invoke this function once.
//
-// Be aware that these comments will not have reply trees. If you are interested
-// in comment trees, save the permalinks of their parent posts and fetch them
-// later..
+// Be aware that these comments are new, and will not have reply trees. If you
+// are interested in comment trees, save the permalinks of their parent posts
+// and fetch them later once they may have had activity.
func SubredditComments(
scanner reddit.Scanner,
kill <-chan bool, | Fix comment docs on post and comment streams. |
diff --git a/html-lint.js b/html-lint.js
index <HASH>..<HASH> 100644
--- a/html-lint.js
+++ b/html-lint.js
@@ -791,7 +791,7 @@
jQuery: '1.7.2',
jQueryUI: '1.8.18',
- Modernizr: '2.6',
+ Modernizr: '2.6.1',
MooTools: '1.4.5',
YUI: '3.5.1'
}; | check for latest version of Modernizr |
diff --git a/lib/bless/parser.js b/lib/bless/parser.js
index <HASH>..<HASH> 100644
--- a/lib/bless/parser.js
+++ b/lib/bless/parser.js
@@ -26,6 +26,10 @@ bless.Parser = function Parser(env) {
var selectors = str.match(/[^,\{\}]*(,|\{[^\{\}]*\}\s*)/g);
if(!selectors) {
+ files.push({
+ filename: output,
+ content: str
+ });
callback(error, files);
return;
} | Correctly writing output file even if source file contains no selectors in order for cleaup to work properly. |
diff --git a/i3pystatus/cpu_usage.py b/i3pystatus/cpu_usage.py
index <HASH>..<HASH> 100644
--- a/i3pystatus/cpu_usage.py
+++ b/i3pystatus/cpu_usage.py
@@ -40,7 +40,6 @@ class CpuUsage(IntervalModule):
def init(self):
self.prev_total = defaultdict(int)
self.prev_busy = defaultdict(int)
- self.interval = 1
self.formatter = Formatter()
def get_cpu_timings(self): | remove the module specific and hard coded interval in cpu_usage |
diff --git a/lib/puppet/provider/service/launchd.rb b/lib/puppet/provider/service/launchd.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/provider/service/launchd.rb
+++ b/lib/puppet/provider/service/launchd.rb
@@ -51,8 +51,6 @@ Puppet::Type.type(:service).provide :launchd, :parent => :base do
"/System/Library/LaunchDaemons"]
Launchd_Overrides = "/var/db/launchd.db/com.apple.launchd/overrides.plist"
- @product_version = Facter.value(:macosx_productversion_major) ? Facter.value(:macosx_productversion_major) : (sw_vers "-productVersion")
- fail("#{@product_version} is not supported by the launchd provider") if %w{10.0 10.1 10.2 10.3}.include?(@product_version)
# Caching is enabled through the following three methods. Self.prefetch will
# call self.instances to create an instance for each service. Self.flush will
@@ -133,6 +131,7 @@ Puppet::Type.type(:service).provide :launchd, :parent => :base do
# it is 10.6 or greater. This allows us to implement different plist
# behavior for versions >= 10.6
def has_macosx_plist_overrides?
+ @product_version = self.class.get_macosx_version_major
return true unless /^10\.[0-5]/.match(@product_version)
return false
end | Change method used to get Fact Value
A previous commit had me change the way we get the value of
the macosx_productversion_major fact. This commmit changes
the method to use the self.get_macosx_version_major method. |
diff --git a/backbone.statemachine.js b/backbone.statemachine.js
index <HASH>..<HASH> 100644
--- a/backbone.statemachine.js
+++ b/backbone.statemachine.js
@@ -34,6 +34,8 @@ Backbone.StateMachine = (function(Backbone, _){
// Declares a new transition on the state machine.
transition: function(leaveState, event, data) {
data = _.clone(data);
+ if (!(this._states.hasOwnProperty(leaveState)))
+ this.state(leaveState, {});
if (!(this._states.hasOwnProperty(data.enterState)))
this.state(data.enterState, {});
if (!(this._transitions.hasOwnProperty(leaveState))) | fixed small bug when leaveState is not declared |
diff --git a/library/Drakojn/Io/Mapper/Map.php b/library/Drakojn/Io/Mapper/Map.php
index <HASH>..<HASH> 100644
--- a/library/Drakojn/Io/Mapper/Map.php
+++ b/library/Drakojn/Io/Mapper/Map.php
@@ -1,6 +1,9 @@
<?php
namespace Drakojn\Io\Mapper;
+use InvalidArgumentException;
+use ReflectionObject;
+
class Map
{
protected $localName;
@@ -90,16 +93,16 @@ class Map
* Extract values from a given object
* @param object $object
* @return array
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
*/
public function getData($object)
{
if(!$this->validateObject($object)){
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
"Given object isn\'t instance of {$this->localName}"
);
}
- $reflection = new \ReflectionObject($object);
+ $reflection = new ReflectionObject($object);
$data = [];
foreach(array_keys($this->properties) as $localProperty){
$property = $reflection->getProperty($localProperty);
@@ -116,6 +119,6 @@ class Map
*/
public function validateObject($object)
{
- return is_a($object, $this->localName);
+ return ($object instanceof $this->localName);
}
} | Import namespaces on top of file
- Use of `instanceof` operator instead `is_a()` |
diff --git a/pkg/services/alerting/notifier.go b/pkg/services/alerting/notifier.go
index <HASH>..<HASH> 100644
--- a/pkg/services/alerting/notifier.go
+++ b/pkg/services/alerting/notifier.go
@@ -3,6 +3,7 @@ package alerting
import (
"errors"
"fmt"
+ "time"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/components/imguploader"
@@ -126,7 +127,7 @@ func (n *notificationService) uploadImage(context *EvalContext) (err error) {
renderOpts := rendering.Opts{
Width: 1000,
Height: 500,
- Timeout: alertTimeout / 2,
+ Timeout: time.Duration(float64(alertTimeout) * 0.9),
OrgId: context.Rule.OrgId,
OrgRole: m.ROLE_ADMIN,
ConcurrentLimit: setting.AlertingRenderLimit, | allow <I> percent of alertTimeout for rendering to complete vs <I> percent |
diff --git a/src/Rocketeer/RocketeerServiceProvider.php b/src/Rocketeer/RocketeerServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/Rocketeer/RocketeerServiceProvider.php
+++ b/src/Rocketeer/RocketeerServiceProvider.php
@@ -133,7 +133,7 @@ class RocketeerServiceProvider extends ServiceProvider
public function bindUserCommands()
{
// Custom tasks
- $tasks = $this->app['config']->get('rocketeer::tasks.custom');
+ $tasks = (array) $this->app['config']->get('rocketeer::tasks.custom');
foreach ($tasks as &$task) {
$task = $this->app['rocketeer.tasks']->buildTask($task);
$command = 'deploy.'.$task->getSlug(); | Fix case where no user commands are defined |
diff --git a/instabot/utils.py b/instabot/utils.py
index <HASH>..<HASH> 100644
--- a/instabot/utils.py
+++ b/instabot/utils.py
@@ -25,6 +25,9 @@ class file(object):
for i in self.list:
yield next(iter(i))
+ def __len__(self):
+ return len(self.list)
+
def append(self, item, allow_duplicates=False):
if self.verbose:
msg = "Adding '{}' to `{}`.".format(item, self.fname) | Add __len__ into file class |
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@
"""cookiecutter distutils configuration."""
from setuptools import setup
-version = "2.0.0"
+version = "2.0.3.dev0"
with open('README.md', encoding='utf-8') as readme_file:
readme = readme_file.read()
@@ -34,7 +34,7 @@ setup(
package_dir={'cookiecutter': 'cookiecutter'},
entry_points={'console_scripts': ['cookiecutter = cookiecutter.__main__:main']},
include_package_data=True,
- python_requires='>=3.6',
+ python_requires='>=3.7',
install_requires=requirements,
license='BSD',
zip_safe=False,
@@ -46,10 +46,10 @@ setup(
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
- "Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
+ "Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python", | update troove classifiers, version and required python version |
diff --git a/lib/sinatra/showexceptions.rb b/lib/sinatra/showexceptions.rb
index <HASH>..<HASH> 100644
--- a/lib/sinatra/showexceptions.rb
+++ b/lib/sinatra/showexceptions.rb
@@ -22,7 +22,7 @@ module Sinatra
rescue Exception => e
errors, env["rack.errors"] = env["rack.errors"], @@eats_errors
- if respond_to?(:prefers_plain_text?) and prefers_plain_text?(env)
+ if prefers_plain_text?(env)
content_type = "text/plain"
body = [dump_exception(e)]
else
@@ -40,6 +40,10 @@ module Sinatra
private
+ def prefers_plain_text?(env)
+ [/curl/].index{|item| item =~ env["HTTP_USER_AGENT"]}
+ end
+
def frame_class(frame)
if frame.filename =~ /lib\/sinatra.*\.rb/
"framework" | Added plain text stack trace output if a cURL user agent is detected. |
diff --git a/src/Illuminate/Database/DetectsLostConnections.php b/src/Illuminate/Database/DetectsLostConnections.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Database/DetectsLostConnections.php
+++ b/src/Illuminate/Database/DetectsLostConnections.php
@@ -42,6 +42,7 @@ trait DetectsLostConnections
'Login timeout expired',
'Connection refused',
'running with the --read-only option so it cannot execute this statement',
+ 'The connection is broken and recovery is not possible. The connection is marked by the client driver as unrecoverable. No attempt was made to restore the connection.',
]);
}
} | Add 'The connection is broken and recovery is not possible.' thrown by Microsoft ODBC Driver to the list of causedByLostConnection error messages (#<I>) |
diff --git a/src/main/java/org/msgpack/MessagePack.java b/src/main/java/org/msgpack/MessagePack.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/msgpack/MessagePack.java
+++ b/src/main/java/org/msgpack/MessagePack.java
@@ -47,7 +47,6 @@ public class MessagePack {
registry = new TemplateRegistry(msgpack.registry);
}
-
public Packer createPacker(OutputStream stream) {
return new MessagePackPacker(this, stream);
}
@@ -180,9 +179,6 @@ public class MessagePack {
registry.register(type);
}
- // TODO #MN
- // public void forceRegister(Class<?> type);
-
public <T> void register(Class<T> type, Template<T> tmpl) {
registry.register(type, tmpl);
} | deleted dead codes in MessagePack.java |
diff --git a/src/components/__tests__/pagination.js b/src/components/__tests__/pagination.js
index <HASH>..<HASH> 100644
--- a/src/components/__tests__/pagination.js
+++ b/src/components/__tests__/pagination.js
@@ -89,3 +89,27 @@ test('it should be hidden if there are no results in the current context', () =>
expect(vm.$el.outerHTML).toMatchSnapshot();
});
+
+test('it should emit a "page-change" event when page changes', () => {
+ const searchStore = {
+ page: 1,
+ totalPages: 20,
+ totalResults: 4000,
+ };
+ const Component = Vue.extend(Pagination);
+ const vm = new Component({
+ propsData: {
+ searchStore,
+ },
+ });
+
+ const onPageChange = jest.fn();
+ vm.$on('page-change', onPageChange);
+
+ vm.$mount();
+
+ expect(onPageChange).not.toHaveBeenCalled();
+
+ vm.$el.getElementsByTagName('li')[3].getElementsByTagName('a')[0].click();
+ expect(onPageChange).toHaveBeenCalledTimes(1);
+}); | test(pagination): test that page-change event is emitted |
diff --git a/ipwhois/asn.py b/ipwhois/asn.py
index <HASH>..<HASH> 100644
--- a/ipwhois/asn.py
+++ b/ipwhois/asn.py
@@ -600,7 +600,7 @@ class ASNOrigin:
net_start (:obj:`int`): The starting point of the network (if
parsing multiple networks). Defaults to None.
net_end (:obj:`int`): The ending point of the network (if parsing
- multiple ks). Defaults to None.
+ multiple networks). Defaults to None.
field_list (:obj:`list`): If provided, a list of fields to parse:
['description', 'maintainer', 'updated', 'source']
If None, defaults to all fields. | docstring typo fix (#<I>) |
diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py
index <HASH>..<HASH> 100644
--- a/discord/ext/commands/bot.py
+++ b/discord/ext/commands/bot.py
@@ -139,7 +139,7 @@ class Bot(GroupMixin, discord.Client):
self.extra_events = {}
self.cogs = {}
self.extensions = {}
- self.description = inspect.cleandoc(description)
+ self.description = inspect.cleandoc(description) if description else ''
self.pm_help = pm_help
if formatter is not None:
if not isinstance(formatter, HelpFormatter): | [commands] Fix issue where Bot would raise if not given a description. |
diff --git a/jest.config.js b/jest.config.js
index <HASH>..<HASH> 100644
--- a/jest.config.js
+++ b/jest.config.js
@@ -4,6 +4,7 @@ const commonConfig = {
setupFilesAfterEnv: [
'<rootDir>/packages/cozy-stack-client/src/__tests__/setup.js'
],
+ watchPathIgnorePatterns: ['node_modules'],
modulePathIgnorePatterns: ['<rootDir>/packages/.*/dist/'],
transformIgnorePatterns: ['node_modules/(?!(cozy-ui))'],
testEnvironment: 'jest-environment-jsdom-sixteen', | fix: Prevent Too many open files error
Do not watch node_modules since there are too many files
in there |
diff --git a/pkg/cmd/grafana-cli/commands/commands.go b/pkg/cmd/grafana-cli/commands/commands.go
index <HASH>..<HASH> 100644
--- a/pkg/cmd/grafana-cli/commands/commands.go
+++ b/pkg/cmd/grafana-cli/commands/commands.go
@@ -57,7 +57,7 @@ func runPluginCommand(command func(commandLine utils.CommandLine) error) func(co
return err
}
- logger.Info("\nRestart grafana after installing plugins . <service grafana-server restart>\n\n")
+ logger.Info("\nRestart Grafana after installing plugins. Refer to Grafana documentation for instructions if necessary.\n\n\n\n")
return nil
}
} | Update logger message to be more generic (#<I>) |
diff --git a/Model/ContactTopic.php b/Model/ContactTopic.php
index <HASH>..<HASH> 100644
--- a/Model/ContactTopic.php
+++ b/Model/ContactTopic.php
@@ -56,5 +56,4 @@ class ContactTopic implements ContactTopicInterface
{
return $this->title;
}
-
-}
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/Model/ContactTopicInterface.php b/Model/ContactTopicInterface.php
index <HASH>..<HASH> 100644
--- a/Model/ContactTopicInterface.php
+++ b/Model/ContactTopicInterface.php
@@ -28,5 +28,4 @@ interface ContactTopicInterface
* @param string $title
*/
public function setTitle($title);
-
}
\ No newline at end of file
diff --git a/spec/Sylius/Component/Contact/Model/ContactTopicSpec.php b/spec/Sylius/Component/Contact/Model/ContactTopicSpec.php
index <HASH>..<HASH> 100644
--- a/spec/Sylius/Component/Contact/Model/ContactTopicSpec.php
+++ b/spec/Sylius/Component/Contact/Model/ContactTopicSpec.php
@@ -43,5 +43,4 @@ class ContactTopicSpec extends ObjectBehavior
$this->setTitle('Title');
$this->getTitle()->shouldReturn('Title');
}
-
} | Removed new lines at the end of files |
diff --git a/lib/tinymce/rails/helper.rb b/lib/tinymce/rails/helper.rb
index <HASH>..<HASH> 100644
--- a/lib/tinymce/rails/helper.rb
+++ b/lib/tinymce/rails/helper.rb
@@ -59,5 +59,6 @@ module TinyMCE::Rails
# Allow methods to be called as module functions:
# e.g. TinyMCE::Rails.tinymce_javascript
module_function :tinymce, :tinymce_javascript, :tinymce_configuration
+ public :tinymce, :tinymce_javascript, :tinymce_configuration
end
end | Ensure that helper methods are public |
diff --git a/compara/reconstruct.py b/compara/reconstruct.py
index <HASH>..<HASH> 100644
--- a/compara/reconstruct.py
+++ b/compara/reconstruct.py
@@ -76,14 +76,17 @@ def fuse(args):
logging.debug("Total families: {}, Gene members: {}"\
.format(len(families), len(allowed)))
+ # TODO: Use C++ implementation of BiGraph() when available
+ # For now just serialize this to the disk
G = BiGraph()
for bedfile in bedfiles:
bed = Bed(bedfile, include=allowed)
add_bed_to_graph(G, bed, families)
- for path in G.iter_paths():
- m, oo = G.path(path)
- print m
+ G.write(filename="graph.edges")
+ #for path in G.iter_paths():
+ # m, oo = G.path(path)
+ # print m
def adjgraph(args): | [compara] Write edges in reconstruct.fuse() |
diff --git a/dxm/src/main/java/io/pcp/parfait/dxm/semantics/UnitMapping.java b/dxm/src/main/java/io/pcp/parfait/dxm/semantics/UnitMapping.java
index <HASH>..<HASH> 100644
--- a/dxm/src/main/java/io/pcp/parfait/dxm/semantics/UnitMapping.java
+++ b/dxm/src/main/java/io/pcp/parfait/dxm/semantics/UnitMapping.java
@@ -76,7 +76,7 @@ public final class UnitMapping {
return false;
}
Unit<?> divided = left.divide(right);
- if (!divided.getDimension().equals(NONE)) {
+ if (!divided.getDimension().equals(Dimension.NONE)) {
return false;
}
return divided.asType(Dimensionless.class).getConverterTo(ONE).equals(IDENTITY); | Resolve a type issue found by Coverity scanning
We were using Unit.NONE instead of Dimension.NONE
in one call site by accident. In practice not an
issue, by good fortune, but may as well fix it up. |
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -14,7 +14,7 @@ def readme():
setup(
name="quilt",
- version="2.5.0",
+ version="2.5.1",
packages=find_packages(),
description='Quilt is an open-source data frame registry',
long_description=readme(),
@@ -32,7 +32,7 @@ setup(
author_email='contact@quiltdata.io',
license='LICENSE',
url='https://github.com/quiltdata/quilt',
- download_url='https://github.com/quiltdata/quilt/releases/tag/2.5.0-beta',
+ download_url='https://github.com/quiltdata/quilt/releases/tag/2.5.1-beta',
keywords='quilt quiltdata shareable data dataframe package platform pandas',
install_requires=[
'appdirs>=1.4.0', | Updating version to <I> (#<I>) |
diff --git a/confuse.py b/confuse.py
index <HASH>..<HASH> 100644
--- a/confuse.py
+++ b/confuse.py
@@ -1246,7 +1246,7 @@ class Choice(Template):
except ValueError:
self.fail(
u'must be one of {0}, not {1}'.format(
- repr(c.value for c in self.choices),
+ repr([c.value for c in self.choices]),
repr(value)
),
view
diff --git a/test/test_validation.py b/test/test_validation.py
index <HASH>..<HASH> 100644
--- a/test/test_validation.py
+++ b/test/test_validation.py
@@ -90,6 +90,16 @@ class BuiltInValidatorTest(unittest.TestCase):
res = config['foo'].as_choice(Foobar)
self.assertEqual(res, Foobar.Foo)
+ @unittest.skipUnless(SUPPORTS_ENUM,
+ "enum not supported in this version of Python.")
+ def test_as_choice_with_enum_error(self):
+ class Foobar(enum.Enum):
+ Foo = 'bar'
+
+ config = _root({'foo': 'foo'})
+ with self.assertRaises(confuse.ConfigValueError):
+ config['foo'].as_choice(Foobar)
+
def test_as_number_float(self):
config = _root({'f': 1.0})
config['f'].as_number() | fixed bug in exception message and added another test case |
diff --git a/src/Factory/SwiftMessageFactory.php b/src/Factory/SwiftMessageFactory.php
index <HASH>..<HASH> 100644
--- a/src/Factory/SwiftMessageFactory.php
+++ b/src/Factory/SwiftMessageFactory.php
@@ -23,6 +23,6 @@ class SwiftMessageFactory
*/
public function create()
{
- return \Swift_Message::newInstance();
+ return new \Swift_Message();
}
} | Update Swiftmailer to <I> as 2.x has security risks |
diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -23,7 +23,7 @@ async function run(req, res, fn, onError) {
const val = await fn(req, res)
// return a non-null value -> send with 200
- if (null != val) {
+ if (null !== val && undefined !== val) {
send(res, 200, val)
}
} catch (err) { | Use !== instead of !=
This seems to conflict with the project's styleguide. |
diff --git a/landez/tiles.py b/landez/tiles.py
index <HASH>..<HASH> 100644
--- a/landez/tiles.py
+++ b/landez/tiles.py
@@ -242,12 +242,11 @@ class MBTilesBuilder(object):
try:
image = urllib.URLopener()
image.retrieve(url, output)
- break
+ return # Done.
except IOError, e:
logger.debug("Download error, retry (%s left). (%s)" % (r, e))
r -= 1
- if r == 0:
- raise DownloadError
+ raise DownloadError
def render_tile(self, output, z, x, y):
""" | Small refactor of retry loop |
diff --git a/test/cli-parse.js b/test/cli-parse.js
index <HASH>..<HASH> 100644
--- a/test/cli-parse.js
+++ b/test/cli-parse.js
@@ -189,7 +189,7 @@ test('cli-parse: scripts arguments: *', async (t) => {
t.end();
});
-test('cli-parse: scripts arguments: *', async (t) => {
+test('cli-parse: scripts arguments: simple', async (t) => {
const result = await cliParse(['one', '--', '--fix'], {
'one': 'redrun one:*',
'one:ls': 'ls',
diff --git a/test/redrun.js b/test/redrun.js
index <HASH>..<HASH> 100644
--- a/test/redrun.js
+++ b/test/redrun.js
@@ -198,7 +198,7 @@ test('parse redrun args: "--": npm run', async (t) => {
t.end();
});
-test('parse redrun args: "--": npm run', async (t) => {
+test('parse redrun args: "--": npm run: should not add quotes', async (t) => {
const expect = 'nodemon -w lib --exec \'nyc tape test.js\'';
const result = await redrun('watch-coverage', {
'watcher': 'nodemon -w lib --exec', | test(redrun) get rid of duplicates |
diff --git a/aiidalab_widgets_base/structures.py b/aiidalab_widgets_base/structures.py
index <HASH>..<HASH> 100644
--- a/aiidalab_widgets_base/structures.py
+++ b/aiidalab_widgets_base/structures.py
@@ -259,12 +259,11 @@ class StructureUploadWidget(ipw.VBox):
def _on_file_upload(self, change=None):
"""When file upload button is pressed."""
for fname, item in change['new'].items():
- fobj = io.BytesIO(item['content'])
frmt = fname.split('.')[-1]
if frmt == 'cif':
- self.structure = CifData(file=fobj)
+ self.structure = CifData(file=io.BytesIO(item['content']))
else:
- self.structure = get_ase_from_file(fobj, format=frmt)
+ self.structure = get_ase_from_file(io.StringIO(item['content'].decode()), format=frmt)
self.file_upload.value.clear()
break | Fix StructureUploadWidget (#<I>)
Currently we are using different file readers for cif files and all
the other file types. CifFile reader expect to recieve a bytes like
object, while ASE reader expects a string-like. This PR introduces
this distinction. |
diff --git a/pystache/parsed.py b/pystache/parsed.py
index <HASH>..<HASH> 100644
--- a/pystache/parsed.py
+++ b/pystache/parsed.py
@@ -37,7 +37,11 @@ class ParsedTemplate(object):
Returns: a string of type unicode.
"""
- get_unicode = lambda val: val(context) if callable(val) else val
+ # We avoid use of the ternary operator for Python 2.4 support.
+ def get_unicode(val):
+ if callable(val):
+ return val(context)
+ return val
parts = map(get_unicode, self._parse_tree)
s = ''.join(parts) | Removed another use of the ternary operator for Python <I> support. |
diff --git a/test/middleware_stack_test.rb b/test/middleware_stack_test.rb
index <HASH>..<HASH> 100644
--- a/test/middleware_stack_test.rb
+++ b/test/middleware_stack_test.rb
@@ -138,7 +138,8 @@ class MiddlewareStackTest < Faraday::TestCase
err = assert_raises RuntimeError do
@conn.get('/')
end
- assert_equal "missing dependency for MiddlewareStackTest::Broken: cannot load such file -- zomg/i_dont/exist", err.message
+ assert_match "missing dependency for MiddlewareStackTest::Broken: ", err.message
+ assert_match "zomg/i_dont/exist", err.message
end
private | don't try to predict exact load error messages for various rubies |
diff --git a/lib/sbsm/redirector.rb b/lib/sbsm/redirector.rb
index <HASH>..<HASH> 100644
--- a/lib/sbsm/redirector.rb
+++ b/lib/sbsm/redirector.rb
@@ -14,7 +14,12 @@ module SBSM
end
end
def redirect?
- @state.direct_event && @request_method != 'GET'
+ #return @state.direct_event && @request_method != 'GET'
+ direct = @state.direct_event
+ if(direct.is_a?(Array))
+ direct = direct.first
+ end
+ direct && ![direct, :sort].include?(event)
end
def to_html
if(redirect?)
diff --git a/lib/sbsm/validator.rb b/lib/sbsm/validator.rb
index <HASH>..<HASH> 100644
--- a/lib/sbsm/validator.rb
+++ b/lib/sbsm/validator.rb
@@ -23,7 +23,6 @@
# Validator -- sbsm -- 15.11.2002 -- hwyss@ywesee.com
require 'digest/md5'
-require 'iconv'
require 'rmail'
require 'date'
require 'drb/drb' | Redirector: redirect everything except the direct event and :sort |
diff --git a/transport/http/src/main/java/org/kaazing/gateway/transport/http/HttpConnector.java b/transport/http/src/main/java/org/kaazing/gateway/transport/http/HttpConnector.java
index <HASH>..<HASH> 100644
--- a/transport/http/src/main/java/org/kaazing/gateway/transport/http/HttpConnector.java
+++ b/transport/http/src/main/java/org/kaazing/gateway/transport/http/HttpConnector.java
@@ -446,8 +446,7 @@ public class HttpConnector extends AbstractBridgeConnector<DefaultHttpSession> {
}
}
- private void doRedirectReceived(final IoSessionEx session, DefaultHttpSession httpSession, HttpMessage httpContent)
- throws URISyntaxException {
+ private void doRedirectReceived(final IoSessionEx session, DefaultHttpSession httpSession, HttpMessage httpContent) {
if (httpContent.isComplete()) {
if (shouldFollowRedirects(httpSession)) {
followRedirect(httpSession, session); | Removed unneeded throws from HttpConnector#doRedirectReceived |
diff --git a/core/src/main/java/com/savoirtech/eos/pattern/whiteboard/KeyedWhiteboard.java b/core/src/main/java/com/savoirtech/eos/pattern/whiteboard/KeyedWhiteboard.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/savoirtech/eos/pattern/whiteboard/KeyedWhiteboard.java
+++ b/core/src/main/java/com/savoirtech/eos/pattern/whiteboard/KeyedWhiteboard.java
@@ -64,13 +64,13 @@ public class KeyedWhiteboard<K, S> extends AbstractWhiteboard<S, K> {
protected K addService(S service, ServiceProperties props) {
K key = keyFunction.apply(service, props);
if (key != null) {
- S registered = serviceMap.computeIfAbsent(key, k -> service);
- if (registered != service) {
+ if (serviceMap.putIfAbsent(key, service) != null) {
getLogger().error("Duplicate key \"{}\" detected for service {}.", key, props.getServiceId());
- key = null;
+ return null;
}
+ return key;
}
- return key;
+ return null;
}
/** | Fixing KeyedWhiteboard's duplicate detection logic. |
diff --git a/shared/fetcher.js b/shared/fetcher.js
index <HASH>..<HASH> 100644
--- a/shared/fetcher.js
+++ b/shared/fetcher.js
@@ -212,7 +212,9 @@ Fetcher.prototype.isMissingKeys = function(modelData, keys) {
};
Fetcher.prototype.fetchFromApi = function(spec, callback) {
- var model = this.getModelOrCollectionForSpec(spec);
+ var _fetcher = this
+ , model = this.getModelOrCollectionForSpec(spec)
+ ;
model.fetch({
data: spec.params,
success: function(model, body) {
@@ -224,7 +226,7 @@ Fetcher.prototype.fetchFromApi = function(spec, callback) {
body = resp.body;
resp.body = typeof body === 'string' ? body.slice(0, 150) : body;
respOutput = JSON.stringify(resp);
- err = new Error("ERROR fetching model '" + this.modelUtils.modelName(model.constructor) + "' with options '" + JSON.stringify(options) + "'. Response: " + respOutput);
+ err = new Error("ERROR fetching model '" + _fetcher.modelUtils.modelName(model.constructor) + "' with options '" + JSON.stringify(options) + "'. Response: " + respOutput);
err.status = resp.status;
err.body = body;
callback(err); | Another out-of-context-this left behind enemy lines. |
diff --git a/ratings/models.py b/ratings/models.py
index <HASH>..<HASH> 100644
--- a/ratings/models.py
+++ b/ratings/models.py
@@ -5,7 +5,7 @@ from django.db import models, IntegrityError
from django.template.defaultfilters import slugify
from django.utils.hashcompat import sha_constructor
-from ratings.utils import get_content_object_field, is_gfk
+from ratings.utils import get_content_object_field, is_gfk, recommended_items
class RatedItemBase(models.Model):
score = models.FloatField(default=0, db_index=True)
@@ -197,6 +197,9 @@ class _RatingsDescriptor(object):
def similar_items(self, item):
return SimilarItem.objects.get_for_item(item)
+ def recommended_items(self, user):
+ return recommended_items(self.all(), user)
+
def order_by_rating(self, aggregator=models.Sum, descending=True):
ordering = descending and '-score' or 'score'
related_field = self.get_content_object_field() | Adding recommended items method to the RatingsDescriptor |
diff --git a/descriptor/qsaratomic/src/main/java/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_G3R.java b/descriptor/qsaratomic/src/main/java/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_G3R.java
index <HASH>..<HASH> 100644
--- a/descriptor/qsaratomic/src/main/java/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_G3R.java
+++ b/descriptor/qsaratomic/src/main/java/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_G3R.java
@@ -52,7 +52,10 @@ import org.openscience.cdk.tools.manipulator.AtomContainerManipulator;
* This class calculates G3R proton descriptors used in neural networks for H1
* NMR shift {@cdk.cite AiresDeSousa2002}. It only applies to (explicit) hydrogen atoms,
* requires aromaticity to be perceived (possibly done via a parameter), and
- * needs 3D coordinates for all atoms.
+ * needs 3D coordinates for all atoms. This method only calculates values for
+ * protons bonded to specific types of rings or via non-rotatable bonds.
+ * From the original manuscript: "To account for axial and equatorial positions
+ * of protons bonded to cyclohexane-like rings, g3(r) was used"
*
* <table border="1"><caption>Parameters for this descriptor:</caption>
* <tr> | Add a comment explaining this descriptor only applies to certain protons. |
diff --git a/src/sap.ui.mdc/src/sap/ui/mdc/flexibility/PropertyInfoFlex.js b/src/sap.ui.mdc/src/sap/ui/mdc/flexibility/PropertyInfoFlex.js
index <HASH>..<HASH> 100644
--- a/src/sap.ui.mdc/src/sap/ui/mdc/flexibility/PropertyInfoFlex.js
+++ b/src/sap.ui.mdc/src/sap/ui/mdc/flexibility/PropertyInfoFlex.js
@@ -2,8 +2,12 @@
* ! ${copyright}
*/
sap.ui.define([
- 'sap/base/util/merge'
-], function(merge) {
+ "sap/base/util/merge",
+ "sap/ui/fl/changeHandler/Base"
+], function (
+ merge,
+ Base
+) {
"use strict";
/*
@@ -58,6 +62,11 @@ sap.ui.define([
// Set revert data on the change
oChange.setRevertData({ name: oChangeContent.name});
+ } else {
+ return Base.markAsNotApplicable(
+ "Property " + oChangeContent.name + " already exists on control " + oModifier.getId(oControl),
+ /*bAsync*/true
+ );
}
});
}); | [INTERNAL][FIX] sap.ui.mdc: Mark changes as not applicable if property already exists
Change-Id: I6b<I>f9fb1be8b2e<I>d5e<I>ae9a<I>faf6f<I>c
BCP: <I> |
diff --git a/test/specs/scale.logarithmic.tests.js b/test/specs/scale.logarithmic.tests.js
index <HASH>..<HASH> 100644
--- a/test/specs/scale.logarithmic.tests.js
+++ b/test/specs/scale.logarithmic.tests.js
@@ -749,7 +749,7 @@ describe('Logarithmic Scale tests', function() {
}
});
- expect(chart.scales.yScale1.getLabelForIndex(0, 2)).toBe(150);
+ expect(chart.scales.yScale0.getLabelForIndex(0, 2)).toBe(150);
});
describe('when', function() { | Fix logarighmic test to use correct scale (#<I>) |
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -4,8 +4,6 @@ from setuptools import setup
with codecs_open('README.md', 'r', 'utf-8') as f:
README = f.read()
-with codecs_open('CHANGELOG.md', 'r', 'utf-8') as f:
- CHANGELOG = f.read()
setup(
author='Beau Barker', | Remove unnecessary lines from setup.py |
diff --git a/lib/Doctrine/Common/Cache/ChainCache.php b/lib/Doctrine/Common/Cache/ChainCache.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/Common/Cache/ChainCache.php
+++ b/lib/Doctrine/Common/Cache/ChainCache.php
@@ -15,6 +15,9 @@ class ChainCache extends CacheProvider
/** @var CacheProvider[] */
private $cacheProviders = [];
+ /** @var int */
+ private $defaultLifeTimeForDownstreamCacheProviders;
+
/**
* @param CacheProvider[] $cacheProviders
*/
@@ -25,6 +28,11 @@ class ChainCache extends CacheProvider
: array_values($cacheProviders);
}
+ public function setDefaultLifeTimeForDownstreamCacheProviders(int $defaultLifeTimeForDownstreamCacheProviders) : void
+ {
+ $this->defaultLifeTimeForDownstreamCacheProviders = $defaultLifeTimeForDownstreamCacheProviders;
+ }
+
/**
* {@inheritDoc}
*/
@@ -48,7 +56,7 @@ class ChainCache extends CacheProvider
// We populate all the previous cache layers (that are assumed to be faster)
for ($subKey = $key - 1; $subKey >= 0; $subKey--) {
- $this->cacheProviders[$subKey]->doSave($id, $value);
+ $this->cacheProviders[$subKey]->doSave($id, $value, $this->defaultLifeTimeForDownstreamCacheProviders);
}
return $value; | Allow to indicate default TTL for downstream CacheProviders |
diff --git a/transport/src/main/java/io/netty/channel/DefaultChannelHandlerContext.java b/transport/src/main/java/io/netty/channel/DefaultChannelHandlerContext.java
index <HASH>..<HASH> 100755
--- a/transport/src/main/java/io/netty/channel/DefaultChannelHandlerContext.java
+++ b/transport/src/main/java/io/netty/channel/DefaultChannelHandlerContext.java
@@ -1295,7 +1295,7 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements
private void invokeFlush0(ChannelPromise promise) {
Channel channel = channel();
if (!channel.isRegistered() && !channel.isActive()) {
- promise.setFailure(new ClosedChannelException());
+ promise.tryFailure(new ClosedChannelException());
return;
} | Fix a problem where flush future is set more than once |
diff --git a/h2o-algos/src/main/java/hex/tree/SharedTreeModel.java b/h2o-algos/src/main/java/hex/tree/SharedTreeModel.java
index <HASH>..<HASH> 100755
--- a/h2o-algos/src/main/java/hex/tree/SharedTreeModel.java
+++ b/h2o-algos/src/main/java/hex/tree/SharedTreeModel.java
@@ -126,6 +126,20 @@ public abstract class SharedTreeModel<M extends SharedTreeModel<M,P,O>, P extend
}
// Override in subclasses to provide some top-level model-specific goodness
+ @Override protected boolean toJavaCheckTooBig() {
+ // If the number of leaves in a forest is more than N, don't try to render it in the browser as POJO code.
+ try {
+ if ((this._output._treeStats._num_trees * this._output._treeStats._mean_leaves) > 5000) {
+ return true;
+ }
+ }
+ catch (Exception ignore) {
+ // If we can't figure out the answer, assume it's too big.
+ return true;
+ }
+
+ return false;
+ }
@Override protected SB toJavaInit(SB sb, SB fileContext) {
sb.nl();
sb.ip("public boolean isSupervised() { return true; }").nl(); | Added a 'preview' flag to GET Model so the browser can tell the backend when
it's requesting a java pojo. Don't render the full thing if it's huge and
will kill the browser. |
diff --git a/NavigationReactNative/src/android/app/src/main/java/com/navigation/reactnative/NavigationBarView.java b/NavigationReactNative/src/android/app/src/main/java/com/navigation/reactnative/NavigationBarView.java
index <HASH>..<HASH> 100644
--- a/NavigationReactNative/src/android/app/src/main/java/com/navigation/reactnative/NavigationBarView.java
+++ b/NavigationReactNative/src/android/app/src/main/java/com/navigation/reactnative/NavigationBarView.java
@@ -50,6 +50,9 @@ public class NavigationBarView extends AppBarLayout {
));
toolbar = new Toolbar(context);
addView(toolbar, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
+ ((AppBarLayout.LayoutParams) toolbar.getLayoutParams()).setScrollFlags(
+ AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS
+ );
defaultTitleTextColor = getDefaultTitleTextColor();
defaultOverflowIcon = toolbar.getOverflowIcon(); | Tested out scroll flags and they work! |
diff --git a/docker/docker.go b/docker/docker.go
index <HASH>..<HASH> 100644
--- a/docker/docker.go
+++ b/docker/docker.go
@@ -86,7 +86,9 @@ func main() {
log.Fatal(err)
}
// Serve api
- if err := eng.Job("serveapi", flHosts...).Run(); err != nil {
+ job := eng.Job("serveapi", flHosts...)
+ job.Setenv("Logging", true)
+ if err := job.Run(); err != nil {
log.Fatal(err)
}
} else {
diff --git a/server.go b/server.go
index <HASH>..<HASH> 100644
--- a/server.go
+++ b/server.go
@@ -88,7 +88,8 @@ func (srv *Server) ListenAndServe(job *engine.Job) string {
return "Invalid protocol format."
}
go func() {
- chErrors <- ListenAndServe(protoAddrParts[0], protoAddrParts[1], srv, true)
+ // FIXME: merge Server.ListenAndServe with ListenAndServe
+ chErrors <- ListenAndServe(protoAddrParts[0], protoAddrParts[1], srv, job.GetenvBool("Logging"))
}()
}
for i := 0; i < len(protoAddrs); i += 1 { | Engine: optional environment variable 'Logging' in 'serveapi' |
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -15,7 +15,7 @@ author = "Chris Sinchok"
author_email = "csinchok@theonion.com"
license = "BSD"
requires = [
- "Django>=1.8",
+ "Django>=1.8,<1.9",
"django-betty-cropper>=0.2.0",
"djangorestframework==3.1.1",
"django-polymorphic==0.7.1", | We can't upgrade to Django==<I>, yet |
diff --git a/src/resolvedpos.js b/src/resolvedpos.js
index <HASH>..<HASH> 100644
--- a/src/resolvedpos.js
+++ b/src/resolvedpos.js
@@ -71,7 +71,7 @@ class ResolvedPos {
// :: (?number) → number
// The (absolute) position directly before the node at the given
- // level, or, when `level` is `this.level + 1`, the original
+ // level, or, when `level` is `this.depth + 1`, the original
// position.
before(depth) {
depth = this.resolveDepth(depth)
@@ -81,7 +81,7 @@ class ResolvedPos {
// :: (?number) → number
// The (absolute) position directly after the node at the given
- // level, or, when `level` is `this.level + 1`, the original
+ // level, or, when `level` is `this.depth + 1`, the original
// position.
after(depth) {
depth = this.resolveDepth(depth) | Fix confused property name in doc comments |
diff --git a/src/Zephyrus/Utilities/FileSystem/File.php b/src/Zephyrus/Utilities/FileSystem/File.php
index <HASH>..<HASH> 100644
--- a/src/Zephyrus/Utilities/FileSystem/File.php
+++ b/src/Zephyrus/Utilities/FileSystem/File.php
@@ -197,6 +197,17 @@ class File extends FileSystemNode
}
/**
+ * Obtains the last access timestamp of the path/file defined in the constructor. If its a directory, it will
+ * automatically fetch the latest accessed time.
+ *
+ * @return int
+ */
+ public function getLastAccessedTime(): int
+ {
+ return fileatime($this->path);
+ }
+
+ /**
* Updates the modification time of the file to the given timestamp or simply the current time if none is supplied.
*
* @param int|null $timestamp | Added method to get last access time of file |
diff --git a/lib/dynamic_paperclip/attachment.rb b/lib/dynamic_paperclip/attachment.rb
index <HASH>..<HASH> 100644
--- a/lib/dynamic_paperclip/attachment.rb
+++ b/lib/dynamic_paperclip/attachment.rb
@@ -42,7 +42,7 @@ module DynamicPaperclip
url = url(style_name)
- delimiter_char = url.match(/\?.+=/) ? '&' : '?'
+ delimiter_char = url.match(/\?/) ? '&' : '?'
"#{url}#{delimiter_char}s=#{UrlSecurity.generate_hash(style_name)}"
end
@@ -64,4 +64,4 @@ module DynamicPaperclip
@dynamic_styles[name.to_sym] = Paperclip::Style.new(name, StyleNaming.style_definition_from_dynamic_style_name(name), self)
end
end
-end
\ No newline at end of file
+end | Fix to support the paperclip timestamp param which doesn't have a value. |
diff --git a/lib/templates/client/service.js b/lib/templates/client/service.js
index <HASH>..<HASH> 100644
--- a/lib/templates/client/service.js
+++ b/lib/templates/client/service.js
@@ -3,11 +3,11 @@
angular
.module('mean.__pkgName__')
- .factory(__pkgName__);
+ .factory(__class__);
- __pkgName__.$inject = ['__class__'];
+ __class__.$inject = ['__class__'];
- function __pkgName__(__class__) {
+ function __class__(__class__) {
return {
name: '__pkgName__'
}; | Updated to __class__ which seems to have proper capitalization |
diff --git a/asn1crypto/x509.py b/asn1crypto/x509.py
index <HASH>..<HASH> 100644
--- a/asn1crypto/x509.py
+++ b/asn1crypto/x509.py
@@ -363,7 +363,7 @@ class RelativeDistinguishedName(SetOf):
"""
output = []
- values = self._get_values()
+ values = self._get_values(self)
for key in sorted(values.keys()):
output.append('%s: %s' % (key, values[key]))
# Unit separator is used here since the normalization process for | Fix generating the hashable version of an x<I>.RelativeDistinguishedName |
diff --git a/pyjfuzz.py b/pyjfuzz.py
index <HASH>..<HASH> 100644
--- a/pyjfuzz.py
+++ b/pyjfuzz.py
@@ -353,6 +353,11 @@ class JSONFactory:
self.behavior[_kind] -= 0.1
else:
self.behavior[_kind] = 0
+ else:
+ if self.behavior[_kind]+0.1 <= 10:
+ self.behavior[_kind] += 0.1
+ else:
+ self.behavior[_kind] = 10
def fuzz_behavior(self, kind):
""" | Added behavior based fuzzing & better performance |
diff --git a/pyt/cfg.py b/pyt/cfg.py
index <HASH>..<HASH> 100644
--- a/pyt/cfg.py
+++ b/pyt/cfg.py
@@ -600,8 +600,10 @@ class CFG(ast.NodeVisitor):
for n, successor in zip(restore_nodes, restore_nodes[1:]):
n.connect(successor)
- self.nodes[-1].connect(restore_nodes[0])
- self.nodes.extend(restore_nodes)
+ if restore_nodes:
+ self.nodes[-1].connect(restore_nodes[0])
+ self.nodes.extend(restore_nodes)
+
return restore_nodes
def return_handler(self, node, function_nodes, restore_nodes): | Fixed if no nodes have to be restored |
diff --git a/oort/cmdctrl.go b/oort/cmdctrl.go
index <HASH>..<HASH> 100644
--- a/oort/cmdctrl.go
+++ b/oort/cmdctrl.go
@@ -69,6 +69,7 @@ func (o *Server) Start() error {
o.ch = make(chan bool)
o.backend.Start()
go o.serve()
+ o.stopped = false
return nil
}
@@ -85,9 +86,11 @@ func (o *Server) Restart() error {
close(o.ch)
o.waitGroup.Wait()
o.backend.Stop()
+ o.stopped = true
o.ch = make(chan bool)
o.backend.Start()
go o.serve()
+ o.stopped = false
return nil
}
@@ -115,6 +118,7 @@ func (o *Server) Stop() error {
close(o.ch)
o.waitGroup.Wait()
o.backend.Stop()
+ o.stopped = true
return nil
}
@@ -131,6 +135,7 @@ func (o *Server) Exit() error {
close(o.ch)
o.waitGroup.Wait()
o.backend.Stop()
+ o.stopped = true
defer o.shutdownFinished()
return nil
} | Actually mark service as stopped/notstopped |
diff --git a/rest_social_auth/views.py b/rest_social_auth/views.py
index <HASH>..<HASH> 100644
--- a/rest_social_auth/views.py
+++ b/rest_social_auth/views.py
@@ -114,8 +114,9 @@ class BaseSocialAuthView(GenericAPIView):
return Response(resp_data.data)
def get_object(self):
+ auth_data = self.request.auth_data.copy()
user = self.request.user
- manual_redirect_uri = self.request.auth_data.pop('redirect_uri', None)
+ manual_redirect_uri = auth_data.pop('redirect_uri', None)
manual_redirect_uri = self.get_redirect_uri(manual_redirect_uri)
if manual_redirect_uri:
self.request.backend.redirect_uri = manual_redirect_uri | Fix for Queryset immutable error on making post from frontend |
diff --git a/class/AbstractMachine.php b/class/AbstractMachine.php
index <HASH>..<HASH> 100644
--- a/class/AbstractMachine.php
+++ b/class/AbstractMachine.php
@@ -495,7 +495,7 @@ abstract class AbstractMachine
* Invoke state machine transition. State machine is not instance of
* this class, but it is represented by record in database.
*/
- public function invokeTransition(Reference $ref, $transition_name, $args, & $returns, $new_id_callback = null)
+ public function invokeTransition(Reference $ref, $transition_name, $args, & $returns, callable $new_id_callback = null)
{
$state = $ref->state;
@@ -548,7 +548,9 @@ abstract class AbstractMachine
// nop, just pass it back
break;
case self::RETURNS_NEW_ID:
- $new_id_callback($ret);
+ if ($new_id_callback !== null) {
+ $new_id_callback($ret);
+ }
break;
default:
throw new RuntimeException('Unknown semantics of the return value: '.$returns); | AbstractMachine: $new_id_callback must be callable |
diff --git a/scripts/release/build-experimental-typescript.js b/scripts/release/build-experimental-typescript.js
index <HASH>..<HASH> 100755
--- a/scripts/release/build-experimental-typescript.js
+++ b/scripts/release/build-experimental-typescript.js
@@ -19,5 +19,11 @@ fs.writeFileSync(
`export default '${newVersion}';\n`
);
-shell.exec(`NODE_ENV=production VERSION=${newVersion} yarn build`);
-shell.exec('yarn build:types');
+const results = [
+ shell.exec(`NODE_ENV=production VERSION=${newVersion} yarn build`),
+ shell.exec('yarn build:types'),
+];
+
+if (results.some(({ code }) => code !== 0)) {
+ shell.exit(1);
+} | fix(build): ensure build fails when types building fails (#<I>)
* fix(build): ensure build fails when types building fails
* Apply suggestions from code review |
diff --git a/src/effector/__tests__/forward.test.js b/src/effector/__tests__/forward.test.js
index <HASH>..<HASH> 100644
--- a/src/effector/__tests__/forward.test.js
+++ b/src/effector/__tests__/forward.test.js
@@ -1,6 +1,6 @@
//@flow
-import {forward, createEvent, createStore} from 'effector'
+import {forward, createEvent, createStore, createNode} from 'effector'
it('should forward data from one event to another', () => {
const fn = jest.fn()
@@ -25,6 +25,23 @@ it('should forward data from one event to another', () => {
])
})
+describe('raw nodes support', () => {
+ test('single ones', () => {
+ const from = createNode()
+ const to = createNode()
+ expect(() => {
+ forward({from, to})
+ }).not.toThrow()
+ })
+ test('arrays', () => {
+ const from = createNode()
+ const to = createNode()
+ expect(() => {
+ forward({from: [from], to: [to]})
+ }).not.toThrow()
+ })
+})
+
it('should stop forwarding after unsubscribe', () => {
const fn = jest.fn()
const source1 = createEvent<string>() | add tests for forward support for Node |
diff --git a/checkport_test.go b/checkport_test.go
index <HASH>..<HASH> 100644
--- a/checkport_test.go
+++ b/checkport_test.go
@@ -23,12 +23,13 @@ import (
"testing"
)
+// Tests for port availability logic written for server startup sequence.
func TestCheckPortAvailability(t *testing.T) {
tests := []struct {
port int
}{
- {9000},
- {10000},
+ {getFreePort()},
+ {getFreePort()},
}
for _, test := range tests {
// This test should pass if the ports are available | tests: Make sure we try tests on free ports. (#<I>)
Fixes #<I> |
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -262,10 +262,8 @@ Handler.prototype.getUsed = function(author, url, req, res, cb) {
debug("user load", resource.key || resource.url, "with stall", opts.stall);
page.load(resource.url, opts);
h.processMw(page, resource, h.users, req, res);
- page.wait('idle', next);
- } else {
- next();
}
+ next();
});
function next(err) {
if (err) return cb(err);
@@ -273,6 +271,7 @@ Handler.prototype.getUsed = function(author, url, req, res, cb) {
resource.headers['Content-Type'] = 'text/html';
var page = resource.page;
if (!page) return cb(new Error("resource.page is missing for\n" + resource.key));
+ page.wait('idle');
resource.output(page, function(err, str) {
Dom.pool.unlock(page, function(resource) {
// breaks the link when the page is recycled | Always wait idle before outputing user page |
diff --git a/apps/loggregator.go b/apps/loggregator.go
index <HASH>..<HASH> 100644
--- a/apps/loggregator.go
+++ b/apps/loggregator.go
@@ -73,7 +73,7 @@ var _ = AppsDescribe("loggregator", func() {
It("exercises basic loggregator behavior", func() {
Eventually(func() string {
- return helpers.CurlApp(Config, appName, fmt.Sprintf("/log/sleep/%d", hundredthOfOneSecond))
+ return helpers.CurlApp(Config, appName, fmt.Sprintf("/log/sleep/%d", 1000000))
}).Should(ContainSubstring("Muahaha"))
Eventually(logs, Config.DefaultTimeoutDuration()*2).Should(Say("Muahaha")) | Fix the loggregator basic streaming logs test
- Setting the app to log every 1/<I>th of a second appears to overload
log-cache and prevents the CLI from being able to stream logs
- This change may be reverted after talking to the CLI team to see if
this is actually an issue that should be fixed in their codebase |
diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php
index <HASH>..<HASH> 100644
--- a/DependencyInjection/Configuration.php
+++ b/DependencyInjection/Configuration.php
@@ -90,14 +90,18 @@ class Configuration implements ConfigurationInterface
*/
private function addApple($os)
{
- $this->root->
+ $config = $this->root->
children()->
arrayNode($os)->
children()->
booleanNode("sandbox")->defaultFalse()->end()->
scalarNode("pem")->isRequired()->cannotBeEmpty()->end()->
scalarNode("passphrase")->defaultValue("")->end()->
- scalarNode('json_unescaped_unicode')->defaultFalse()->info('PHP >= 5.4.0 and each messaged must be UTF-8 encoding')->end()->
+ scalarNode('json_unescaped_unicode')->defaultFalse();
+ if (method_exists($config,'info')) {
+ $config = $config->info('PHP >= 5.4.0 and each messaged must be UTF-8 encoding');
+ }
+ $config->end()->
end()->
end()->
end() | Test for existence of info method before calling it
We get the benefits of <I> but retain compatibility with <I> |
diff --git a/examples/py/coinone-markets.py b/examples/py/coinone-markets.py
index <HASH>..<HASH> 100644
--- a/examples/py/coinone-markets.py
+++ b/examples/py/coinone-markets.py
@@ -10,7 +10,7 @@ sys.path.append(root + '/python')
import ccxt # noqa: E402
exchange = ccxt.coinone({
- 'enableRateLimit': true,
+ 'enableRateLimit': True,
# 'verbose': True, # uncomment for verbose output
}) | Fix a typo in examples/py/coinone-markets.py |
diff --git a/vcr/errors.py b/vcr/errors.py
index <HASH>..<HASH> 100644
--- a/vcr/errors.py
+++ b/vcr/errors.py
@@ -1,5 +1,7 @@
class CannotOverwriteExistingCassetteException(Exception):
def __init__(self, *args, **kwargs):
+ self.cassette = kwargs["cassette"]
+ self.failed_request = kwargs["failed_request"]
message = self._get_message(kwargs["cassette"], kwargs["failed_request"])
super(CannotOverwriteExistingCassetteException, self).__init__(message) | Add cassette and failed request as properties of thrown CannotOverwriteCassetteException |
diff --git a/source/src/main/java/com/linkedin/uif/source/extractor/extract/QueryBasedExtractor.java b/source/src/main/java/com/linkedin/uif/source/extractor/extract/QueryBasedExtractor.java
index <HASH>..<HASH> 100644
--- a/source/src/main/java/com/linkedin/uif/source/extractor/extract/QueryBasedExtractor.java
+++ b/source/src/main/java/com/linkedin/uif/source/extractor/extract/QueryBasedExtractor.java
@@ -247,6 +247,8 @@ public abstract class QueryBasedExtractor<S, D> implements Extractor<S, D>, Prot
this.log.info("High water mark for the current run: " + currentRunHighWatermark);
this.setRangePredicates(watermarkColumn, watermarkType, lwm, currentRunHighWatermark);
+ // If there are no records in the current run, updating high watermark of the current run to the max value of partition range
+ this.highWatermark = currentRunHighWatermark;
}
// if it is set to true, skip count calculation and set source count to -1 | Updating high watermark of the current run to max value of partition range if there are no records in the current run
RB=<I>
R=stakiar
A=stakiar |
diff --git a/spatialist/raster.py b/spatialist/raster.py
index <HASH>..<HASH> 100644
--- a/spatialist/raster.py
+++ b/spatialist/raster.py
@@ -63,8 +63,8 @@ class Raster(object):
list_separate: bool
treat a list of files as separate layers or otherwise as a single layer? The former is intended for single
layers of a stack, the latter for tiles of a mosaic.
- timestamps: list of str or None
- the time information for each layer
+ timestamps: list[str] or function or None
+ the time information for each layer or a function converting band names to a :obj:`datetime.datetime` object
"""
def __init__(self, filename, list_separate=True, timestamps=None):
@@ -106,10 +106,14 @@ class Raster(object):
else:
self.bandnames = ['band{}'.format(x) for x in range(1, self.bands + 1)]
- if timestamps is not None:
+ if isinstance(timestamps, list):
if len(timestamps) != len(self.bandnames):
raise RuntimeError('the number of time stamps is different to the number of bands')
- self.timestamps = timestamps
+ self.timestamps = timestamps
+ elif callable(timestamps):
+ self.timestamps = [timestamps(x) for x in self.bandnames]
+ else:
+ self.timestamps = None
def __enter__(self):
return self | [Raster] optionally pass a function as timestamps argument to convert bandnames to time stamps |
diff --git a/system/src/Grav/Common/Data/Blueprint.php b/system/src/Grav/Common/Data/Blueprint.php
index <HASH>..<HASH> 100644
--- a/system/src/Grav/Common/Data/Blueprint.php
+++ b/system/src/Grav/Common/Data/Blueprint.php
@@ -72,12 +72,15 @@ class Blueprint
{
// Initialize data
$this->fields();
+
+ // Get language class
+ $language = self::getGrav()['language'];
try {
$this->validateArray($data, $this->nested);
} catch (\RuntimeException $e) {
- $language = self::getGrav()['language'];
- throw new \RuntimeException(sprintf('<b>Validation failed:</b> %s', $language->translate($e->getMessage())));
+ $message = sprintf($language->translate('FORM.VALIDATION_FAIL', null, true) . ' %s', $e->getMessage());
+ throw new \RuntimeException($message);
}
} | Added a translation for "Validation failed:" text
The English term "Validation failed:" was hard coded on line <I>. Instead, I created a translation and placed this at /system/languages/en.yaml. It will need to be translated into other languages by others. |
diff --git a/annis-service/src/main/java/annis/administration/SchemeFixer.java b/annis-service/src/main/java/annis/administration/SchemeFixer.java
index <HASH>..<HASH> 100644
--- a/annis-service/src/main/java/annis/administration/SchemeFixer.java
+++ b/annis-service/src/main/java/annis/administration/SchemeFixer.java
@@ -94,6 +94,9 @@ public class SchemeFixer
catch (SQLException ex)
{
log.error("Could not get the metadata for the database", ex);
+ }
+ finally
+ {
if(result != null)
{
try | close resources in finally and not in the catch block |
diff --git a/utils/relationship.js b/utils/relationship.js
index <HASH>..<HASH> 100644
--- a/utils/relationship.js
+++ b/utils/relationship.js
@@ -264,7 +264,7 @@ function relationshipToReference(entity, relationship, pathPrefix = []) {
nameCapitalized: collection ? relationship.relationshipNameCapitalizedPlural : relationship.relationshipNameCapitalized,
type: relationship.otherEntity.primaryKeyType,
path: [...pathPrefix, name],
- idReferences: relationship.otherEntity.idFields ? [relationship.otherEntity.idFields.map(field => field.reference)] : [],
+ idReferences: relationship.otherEntity.idFields ? relationship.otherEntity.idFields.map(field => field.reference) : [],
valueReference: relationship.otherEntityField && relationship.otherEntityField.reference,
};
return reference; | Fix idReferences. |
diff --git a/test/integration/generated_regress_test.rb b/test/integration/generated_regress_test.rb
index <HASH>..<HASH> 100644
--- a/test/integration/generated_regress_test.rb
+++ b/test/integration/generated_regress_test.rb
@@ -200,6 +200,13 @@ class GeneratedRegressTest < MiniTest::Spec
end
end
+ describe "#get_property" do
+ it "gets the 'float' property" do
+ @o[:some_float] = 3.14
+ assert_equal 3.14, @o.get_property("float")
+ end
+ end
+
should "have a reference count of 1" do
assert_equal 1, ref_count(@o)
end | Add integration test for GObject::Object#get_property. |
diff --git a/tests/fastpath-test.js b/tests/fastpath-test.js
index <HASH>..<HASH> 100644
--- a/tests/fastpath-test.js
+++ b/tests/fastpath-test.js
@@ -799,8 +799,6 @@ test('fastpath-tests', function (t) {
}
},
tr = fastpath(pattern);
-
- console.info('tr,', tr);
t.deepEqual(tr.evaluate(obj), { results1: {foos: [ [ 1, 2, 3 ], [ 4, 5, 6 ], 12, 13.5, 11.8 ]}, results2: { strrings: [ 'la', 'boo' ] }});
t.end();
}); | Implementation of evaluating nested pattern specs |
diff --git a/examples/clear-space.py b/examples/clear-space.py
index <HASH>..<HASH> 100755
--- a/examples/clear-space.py
+++ b/examples/clear-space.py
@@ -104,7 +104,7 @@ def main(argv=None):
print('Camera has %.1f%% free space' % (
100.0 * float(si.freekbytes) / float(si.capacitykbytes)))
free_space = si.freekbytes
- if free_space >= target:
+ if free_space >= target or len(files) == 0:
break
camera.exit()
return 0 | Exit loop if no files left to delete |
diff --git a/make/release.js b/make/release.js
index <HASH>..<HASH> 100644
--- a/make/release.js
+++ b/make/release.js
@@ -166,7 +166,9 @@ inquirer.prompt([{
).join("\n")
);
fs.writeFileSync("README.md", readmeLines.join("\n"));
+ return noBuild ? 0 : spawnGrunt("jsdoc:public");
})
+ .then(() => noBuild ? 0 : spawnGrunt("copy:publishVersionDoc"))
.then(() => spawnGrunt("zip:platoHistory"))
.then(() => testMode
? console.warn("No GIT publishing in test mode") | Doc is generated once README has been updated (#<I>) |
diff --git a/lib/graphql/relay/mutation.rb b/lib/graphql/relay/mutation.rb
index <HASH>..<HASH> 100644
--- a/lib/graphql/relay/mutation.rb
+++ b/lib/graphql/relay/mutation.rb
@@ -17,7 +17,7 @@ module GraphQL
# input_field :name, !types.String
# input_field :itemId, !types.ID
#
- # return_field :item, Item
+ # return_field :item, ItemType
#
# resolve -> (inputs, ctx) {
# item = Item.find_by_id(inputs[:id]) | return_field argument should be a Type, confusing in example |
diff --git a/lib/perfectqueue/multiprocess/child_process.rb b/lib/perfectqueue/multiprocess/child_process.rb
index <HASH>..<HASH> 100644
--- a/lib/perfectqueue/multiprocess/child_process.rb
+++ b/lib/perfectqueue/multiprocess/child_process.rb
@@ -27,6 +27,7 @@ module PerfectQueue
def initialize(runner, config, wpipe)
@wpipe = wpipe
@wpipe.sync = true
+ @request_per_child = 0
super(runner, config)
@sig = install_signal_handlers
end
@@ -66,6 +67,22 @@ module PerfectQueue
HEARTBEAT_PACKET = [0].pack('C')
+ # override
+ def restart(immediate, config)
+ @max_request_per_child = config[:max_request_per_child] || nil
+ super
+ end
+
+ def process(task)
+ super
+ if @max_request_per_child
+ @request_per_child += 1
+ if @request_per_child > @max_request_per_child
+ stop(false)
+ end
+ end
+ end
+
private
def install_signal_handlers
SignalQueue.start do |sig| | 'process' type multiprocessor supports max_request_per_child option |
diff --git a/storage/rethinkdb/bootstrap.go b/storage/rethinkdb/bootstrap.go
index <HASH>..<HASH> 100644
--- a/storage/rethinkdb/bootstrap.go
+++ b/storage/rethinkdb/bootstrap.go
@@ -47,6 +47,16 @@ func (t Table) wait(session *gorethink.Session, dbName string) error {
resp.Close()
}
+ if err != nil {
+ return err
+ }
+
+ // also try waiting for all table indices
+ resp, err = t.term(dbName).IndexWait().Run(session)
+
+ if resp != nil {
+ resp.Close()
+ }
return err
} | Wait for indexes in rethink table.wait |
diff --git a/fost_authn_debug/tests/test_middleware.py b/fost_authn_debug/tests/test_middleware.py
index <HASH>..<HASH> 100644
--- a/fost_authn_debug/tests/test_middleware.py
+++ b/fost_authn_debug/tests/test_middleware.py
@@ -44,7 +44,7 @@ class InvalidHeader(TestCase):
def _do_test(self, header, gets_user=False):
self.request = MockRequest(header)
- u = self.m.process_request(self.request)
+ self.m.process_request(self.request)
self.assertEquals(hasattr(self.request, 'user'), gets_user)
def test_no_authorization_header(self): | process_request doesn't return anything. |
diff --git a/lib/cantango/api/common.rb b/lib/cantango/api/common.rb
index <HASH>..<HASH> 100644
--- a/lib/cantango/api/common.rb
+++ b/lib/cantango/api/common.rb
@@ -11,7 +11,7 @@ module CanTango::Api
protected
def execution_modes
- CanTango.config.ability.modes.registered || [:no_cache]
+ CanTango.config.ability.modes || [:no_cache]
end
def config
diff --git a/spec/cantango/api/can/account_spec.rb b/spec/cantango/api/can/account_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/cantango/api/can/account_spec.rb
+++ b/spec/cantango/api/can/account_spec.rb
@@ -41,6 +41,14 @@ describe CanTango::Api::Can::Account do
specify do
subject.current_account_ability(:user).modes.should == [:no_cache]
end
+
+ specify do
+ subject.current_account_ability(:user).rules.should_not be_empty
+ end
+
+ specify do
+ subject.current_account_ability(:user).can?(:edit, Article).should be_true
+ end
# user can edit Article, not Admin
specify do | better can-account spec |
diff --git a/lib/parameters/parameters.rb b/lib/parameters/parameters.rb
index <HASH>..<HASH> 100644
--- a/lib/parameters/parameters.rb
+++ b/lib/parameters/parameters.rb
@@ -25,7 +25,7 @@ module Parameters
#
def self.extended(object)
each_param do |param|
- object.params[param.name] = param.to_instance(self)
+ object.params[param.name] = param.to_instance(object)
end
end
end | Pass the extending object to the new InstanceParam. |
diff --git a/api/src/main/java/org/commonjava/indy/model/galley/CacheOnlyLocation.java b/api/src/main/java/org/commonjava/indy/model/galley/CacheOnlyLocation.java
index <HASH>..<HASH> 100644
--- a/api/src/main/java/org/commonjava/indy/model/galley/CacheOnlyLocation.java
+++ b/api/src/main/java/org/commonjava/indy/model/galley/CacheOnlyLocation.java
@@ -68,7 +68,7 @@ public class CacheOnlyLocation
@Override
public boolean allowsStoring()
{
- return !repo.isReadonly();
+ return repo != null && !repo.isReadonly();
}
@Override | prevent NPE in CacheOnlyLocation allowsStoring |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.