diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/girder/utility/__init__.py b/girder/utility/__init__.py
index <HASH>..<HASH> 100644
--- a/girder/utility/__init__.py
+++ b/girder/utility/__init__.py
@@ -40,7 +40,7 @@ except NotImplementedError: # pragma: no cover
def parseTimestamp(x, naive=True):
- '''
+ """
Parse a datetime string using the python-dateutil package.
If no timezone information is included, assume UTC. If timezone information
@@ -48,7 +48,7 @@ def parseTimestamp(x, naive=True):
If naive is True (the default), drop the timezone information such that a
naive datetime is returned.
- '''
+ """
dt = dateutil.parser.parse(x)
if dt.tzinfo:
dt = dt.astimezone(pytz.utc).replace(tzinfo=None)
|
Fix static analysis (double triple quotes)
|
diff --git a/git_repo/services/ext/gogs.py b/git_repo/services/ext/gogs.py
index <HASH>..<HASH> 100644
--- a/git_repo/services/ext/gogs.py
+++ b/git_repo/services/ext/gogs.py
@@ -77,14 +77,13 @@ class GogsService(RepositoryService):
super().__init__(*args, **kwargs)
+ def connect(self):
self.gg.setup(self.url_ro)
self.gg.set_token(self._privatekey)
self.gg.set_default_private(self.default_create_private)
self.gg.setup_session(
self.session_certificate or not self.session_insecure,
self.session_proxy)
-
- def connect(self):
try:
self.username = self.user # Call to self.gg.authenticated_user()
except HTTPError as err:
|
🚒 connection order issue (fixes #<I>)
|
diff --git a/ella/newman/utils.py b/ella/newman/utils.py
index <HASH>..<HASH> 100644
--- a/ella/newman/utils.py
+++ b/ella/newman/utils.py
@@ -30,6 +30,9 @@ def JsonResponse(message, data={}, errors={}, status=200):
'message': message,
}
if data:
+ try: data = json_decode(data)
+ except: pass
+
out_dict['data'] = data
if errors:
out_dict['errors'] = errors
|
JsonResponse will not try to expand JSON data.
|
diff --git a/lib/ezsession/classes/ezsession.php b/lib/ezsession/classes/ezsession.php
index <HASH>..<HASH> 100644
--- a/lib/ezsession/classes/ezsession.php
+++ b/lib/ezsession/classes/ezsession.php
@@ -446,11 +446,7 @@ class eZSession
*/
static protected function forceStart()
{
- if ( self::$handlerInstance instanceof ezpSessionHandler )
- return self::$hasStarted = self::$handlerInstance->sessionStart();
-
- session_start();
- return self::$hasStarted = true;
+ return self::$hasStarted = self::getHandlerInstance()->sessionStart();
}
/**
|
Additional fix EZP-<I>: Warning: session already started when logging in
Make sure handler is always used in standalone mode.
|
diff --git a/geshi/geshi/php.php b/geshi/geshi/php.php
index <HASH>..<HASH> 100644
--- a/geshi/geshi/php.php
+++ b/geshi/geshi/php.php
@@ -90,7 +90,7 @@ $language_data = array(
'as','break','case','continue','default','do','else','elseif',
'endfor','endforeach','endif','endswitch','endwhile','for',
'foreach','if','include','include_once','require','require_once',
- 'return','switch','throw','while','namespace','use',
+ 'return','switch','throw','while','namespace','use', 'try', 'catch',
'echo','print'
),
|
[GeSHi] Adding try & catch
|
diff --git a/src/resources/js/controllers.js b/src/resources/js/controllers.js
index <HASH>..<HASH> 100644
--- a/src/resources/js/controllers.js
+++ b/src/resources/js/controllers.js
@@ -112,6 +112,8 @@
return;
}
+ var blockRequest = false;
+
if ($scope.pager) {
if (n.length == 0) {
$timeout.cancel($scope.searchPromise);
@@ -119,15 +121,22 @@
$scope.config.pagerHiddenByAjaxSearch = false;
} else {
$timeout.cancel($scope.searchPromise);
+
+ if (blockRequest) {
+ return;
+ }
+
$scope.searchPromise = $timeout(function() {
if ($scope.config.fullSearchContainer) {
$scope.data.listArray = $filter('filter')($scope.config.fullSearchContainer, n);
$scope.config.pagerHiddenByAjaxSearch = true;
} else {
+ blockRequest = true;
$http.post($scope.config.apiEndpoint + '/full-response?' + $scope.config.apiListQueryString, {query: n}).success(function(response) {
$scope.config.pagerHiddenByAjaxSearch = true;
$scope.config.fullSearchContainer = response;
$scope.data.listArray = $filter('filter')(response, n);
+ blockRequest = false;
});
}
}, 500)
|
added block request var in order to make sure the full response request
can only run once as it takes usualy longer to resolve the request. #<I>
|
diff --git a/libdokan/dokan_info.go b/libdokan/dokan_info.go
index <HASH>..<HASH> 100644
--- a/libdokan/dokan_info.go
+++ b/libdokan/dokan_info.go
@@ -58,9 +58,9 @@ func logDokanFilesInfo(epc *errorPrinter) {
debugFileInfo(epc, d+shortPath)
}
for _, d := range []string{syswow64, system32} {
- debugFileInfo(epc, d+`DOKAN.SYS`)
- debugFileInfo(epc, d+`DOKAN1.SYS`)
- debugFileInfo(epc, d+`DOKAN2.SYS`)
+ debugFileInfo(epc, d+`DRIVERS\DOKAN.SYS`)
+ debugFileInfo(epc, d+`DRIVERS\DOKAN1.SYS`)
+ debugFileInfo(epc, d+`DRIVERS\DOKAN2.SYS`)
}
}
|
Use correct path for dokanX.sys in debug output
|
diff --git a/src/adapt/cssstyler.js b/src/adapt/cssstyler.js
index <HASH>..<HASH> 100644
--- a/src/adapt/cssstyler.js
+++ b/src/adapt/cssstyler.js
@@ -532,14 +532,12 @@ adapt.cssstyler.columnProps = ["column-count", "column-width", "column-fill"];
* @return {void}
*/
adapt.cssstyler.Styler.prototype.postprocessTopStyle = function(elemStyle, isBody) {
- if (!isBody) {
- ["writing-mode", "direction"].forEach(function(propName) {
- if (elemStyle[propName]) {
- // Copy it over, but keep it at the root element as well.
- this.rootStyle[propName] = elemStyle[propName];
- }
- }, this);
- }
+ ["writing-mode", "direction"].forEach(propName => {
+ if (elemStyle[propName] && !(isBody && this.rootStyle[propName])) {
+ // Copy it over, but keep it at the root element as well.
+ this.rootStyle[propName] = elemStyle[propName];
+ }
+ });
if (!this.rootBackgroundAssigned) {
const backgroundColor = /** @type {adapt.css.Val} */
(this.hasProp(elemStyle, this.validatorSet.backgroundProps, "background-color") ?
|
Fix the bug that the writing mode specified on the body element did not determine the principal (root) writing mode
|
diff --git a/pygsp/graphs/graph.py b/pygsp/graphs/graph.py
index <HASH>..<HASH> 100644
--- a/pygsp/graphs/graph.py
+++ b/pygsp/graphs/graph.py
@@ -80,6 +80,11 @@ class Graph(fourier.GraphFourier, difference.GraphDifference):
if len(W.shape) != 2 or W.shape[0] != W.shape[1]:
raise ValueError('W has incorrect shape {}'.format(W.shape))
+ # Don't keep edges of 0 weight. Otherwise Ne will not correspond to the
+ # real number of edges. Problematic when e.g. plotting.
+ W = sparse.csr_matrix(W)
+ W.eliminate_zeros()
+
self.N = W.shape[0]
self.W = sparse.lil_matrix(W)
|
graphs: eliminate edges of weight 0
|
diff --git a/javascript/LeftAndMain.Tree.js b/javascript/LeftAndMain.Tree.js
index <HASH>..<HASH> 100755
--- a/javascript/LeftAndMain.Tree.js
+++ b/javascript/LeftAndMain.Tree.js
@@ -116,7 +116,7 @@
});
$.ajax({
- 'url': this.data('url-savetreenode'),
+ 'url': self.data('url-savetreenode'),
'data': {
ID: $(movedNode).data('id'),
ParentID: $(newParentNode).data('id') || 0,
|
MINOR Fixed LeftAndMain.Tree.js scope
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -39,11 +39,12 @@ class RustPlugin {
this.serverless.service.package.excludeDevDependencies = false;
}
- runDocker(funcArgs, cargoPackage) {
+ runDocker(funcArgs, cargoPackage, binary) {
const defaultArgs = [
'run',
'--rm',
'-t',
+ '-e', `BIN=${binary}`,
`-v`, `${this.servicePath}:/code`,
`-v`, `${process.env['HOME']}/.cargo/registry:/root/.cargo/registry`,
`-v`, `${process.env['HOME']}/.cargo/git:/root/.cargo/git`,
@@ -100,7 +101,7 @@ class RustPlugin {
binary = cargoPackage;
}
this.serverless.cli.log(`Building native Rust ${func.handler} func...`);
- const res = this.runDocker(func.rust, cargoPackage);
+ const res = this.runDocker(func.rust, cargoPackage, binary);
if (res.error || res.status > 0) {
this.serverless.cli.log(`Dockerized Rust build encountered an error: ${res.error} ${res.status}.`);
throw new Error(res.error);
|
target binary by name (for upcoming release)
|
diff --git a/web/concrete/blocks/form/controller.php b/web/concrete/blocks/form/controller.php
index <HASH>..<HASH> 100644
--- a/web/concrete/blocks/form/controller.php
+++ b/web/concrete/blocks/form/controller.php
@@ -578,7 +578,9 @@ class Controller extends BlockController
}
if (!$this->noSubmitFormRedirect) {
- if ($this->redirectCID > 0) {
+ if ($this->redirectCID == HOME_CID) {
+ $this->redirect(Core::make('url/canonical'));
+ } elseif ($this->redirectCID > 0) {
$pg = Page::getByID($this->redirectCID);
if (is_object($pg) && $pg->cID) {
$this->redirect($pg->getCollectionPath());
|
Fix: unable to redirect to home on submit form block
Former-commit-id: <I>f<I>be3ed<I>b<I>ce5fb6ad<I>e<I>ea4
Former-commit-id: ba3f<I>facbc<I>e<I>d<I>ecc6c<I>b6e<I>
|
diff --git a/lib/oauth/token.rb b/lib/oauth/token.rb
index <HASH>..<HASH> 100644
--- a/lib/oauth/token.rb
+++ b/lib/oauth/token.rb
@@ -69,6 +69,20 @@ module OAuth
# The Access Token is used for the actual "real" web service calls thatyou perform against the server
class AccessToken<ConsumerToken
+
+ # The less intrusive way. Otherwise, if we are to do it correctly inside consumer,
+ # we need to restructure and touch more methods: requst(), sign!(), etc.
+ def request(http_method, path, *arguments)
+ request_uri = URI.parse(path)
+ site_uri = consumer.uri
+ is_service_uri_different = (request_uri != site_uri)
+ consumer.uri(request_uri) if is_service_uri_different
+ resp = super(http_method, path, *arguments)
+ # NOTE: reset for wholesomeness? meaning that we admit only AccessToken service calls may use different URIs?
+ # so reset in case consumer is still used for other token-management tasks subsequently?
+ consumer.uri(site_uri) if is_service_uri_different
+ resp
+ end
# Make a regular get request using AccessToken
#
|
enhancement to allow service (non-token-management-related) requests to
use URIs different from initial site URI.
|
diff --git a/src/Sessions/NativeSession.php b/src/Sessions/NativeSession.php
index <HASH>..<HASH> 100644
--- a/src/Sessions/NativeSession.php
+++ b/src/Sessions/NativeSession.php
@@ -86,7 +86,7 @@ class NativeSession implements SessionInterface
protected function startSession()
{
// Check that the session hasn't already been started
- if (session_id() == '' && ! headers_sent()) {
+ if (session_status() != PHP_SESSION_ACTIVE && ! headers_sent()) {
session_start();
}
}
|
Changing session closed test to PHP <I> construct
If a session has previously been opened then closed, session_id() will have a value. The session then fails to open. In PHP <I> session_status() was introduced which allows testing whether the session is actually open or closed.
With this change, the session is correctly re-opened after it has previously been opened and closed. See <URL>
|
diff --git a/styx-scheduler-service/src/main/java/com/spotify/styx/docker/KubernetesDockerRunner.java b/styx-scheduler-service/src/main/java/com/spotify/styx/docker/KubernetesDockerRunner.java
index <HASH>..<HASH> 100644
--- a/styx-scheduler-service/src/main/java/com/spotify/styx/docker/KubernetesDockerRunner.java
+++ b/styx-scheduler-service/src/main/java/com/spotify/styx/docker/KubernetesDockerRunner.java
@@ -446,7 +446,7 @@ class KubernetesDockerRunner implements DockerRunner {
.getOrDefault(KubernetesDockerRunner.STYX_WORKFLOW_INSTANCE_ANNOTATION, "N/A");
final String status = readStatus(pod);
- LOG.info("{}Pod event for {} at resource version {}, action: {}, workflow instance: {}, status: {}",
+ LOG.debug("{}Pod event for {} at resource version {}, action: {}, workflow instance: {}, status: {}",
polled ? "Polled: " : "", podName, resourceVersion, action, workflowInstance, status);
}
|
log k8s events at debug level
|
diff --git a/proxmoxer/backends/ssh_paramiko.py b/proxmoxer/backends/ssh_paramiko.py
index <HASH>..<HASH> 100644
--- a/proxmoxer/backends/ssh_paramiko.py
+++ b/proxmoxer/backends/ssh_paramiko.py
@@ -56,8 +56,8 @@ class ProxmoxParamikoSession(ProxmoxBaseSSHSession):
cmd = 'sudo ' + cmd
session = self.ssh_client.get_transport().open_session()
session.exec_command(cmd)
- stdout = session.makefile('rb', -1).read().decode()
- stderr = session.makefile_stderr('rb', -1).read().decode()
+ stdout = session.makefile('r', -1).read().decode()
+ stderr = session.makefile_stderr('r', -1).read().decode()
return stdout, stderr
def upload_file_obj(self, file_obj, remote_path):
|
fix from mihailstoynov
|
diff --git a/lib/chef/provider/service.rb b/lib/chef/provider/service.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/provider/service.rb
+++ b/lib/chef/provider/service.rb
@@ -44,16 +44,19 @@ class Chef
supports[:restart] = false if supports[:restart].nil?
end
- def load_new_resource_state
- # If the user didn't specify a change in enabled state,
- # it will be the same as the old resource
- if ( @new_resource.enabled.nil? )
- @new_resource.enabled(@current_resource.enabled)
- end
- if ( @new_resource.running.nil? )
- @new_resource.running(@current_resource.running)
- end
- end
+ # the new_resource#enabled and #running variables are not user input, but when we
+ # do (e.g.) action_enable we want to set new_resource.enabled so that the comparison
+ # between desired and current state produces the correct change in reporting.
+ # XXX?: the #nil? check below will likely fail if this is a cloned resource or if
+ # we just run multiple actions.
+ def load_new_resource_state
+ if ( @new_resource.enabled.nil? )
+ @new_resource.enabled(@current_resource.enabled)
+ end
+ if ( @new_resource.running.nil? )
+ @new_resource.running(@current_resource.running)
+ end
+ end
def shared_resource_requirements
end
|
add better documentation to this method
it violates our dont-violate-the-new-resource policy for a reason, but
is likely still buggy if the resource gets reused.
|
diff --git a/lib/Doctrine/Common/ClassLoader.php b/lib/Doctrine/Common/ClassLoader.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/Common/ClassLoader.php
+++ b/lib/Doctrine/Common/ClassLoader.php
@@ -33,10 +33,25 @@ namespace Doctrine\Common;
*/
class ClassLoader
{
- private $fileExtension = '.php';
- private $namespace;
- private $includePath;
- private $namespaceSeparator = '\\';
+ /**
+ * @var string PHP file extension
+ */
+ protected $fileExtension = '.php';
+
+ /**
+ * @var string Current namespace
+ */
+ protected $namespace;
+
+ /**
+ * @var string Current include path
+ */
+ protected $includePath;
+
+ /**
+ * @var string PHP namespace separator
+ */
+ protected $namespaceSeparator = '\\';
/**
* Creates a new <tt>ClassLoader</tt> that loads classes of the
|
[DCOM-<I>] Increased visibility of members in ClassLoader in order to simplify extensibility through methods' override.
|
diff --git a/server/src/main/java/org/jboss/as/server/deployment/module/ModuleSpecification.java b/server/src/main/java/org/jboss/as/server/deployment/module/ModuleSpecification.java
index <HASH>..<HASH> 100644
--- a/server/src/main/java/org/jboss/as/server/deployment/module/ModuleSpecification.java
+++ b/server/src/main/java/org/jboss/as/server/deployment/module/ModuleSpecification.java
@@ -254,6 +254,24 @@ public class ModuleSpecification extends SimpleAttachable {
this.localDependenciesTransitive = localDependenciesTransitive;
}
+ /**
+ * @deprecated since AS 8.x. Use {@link #isLocalDependenciesTransitive()} instead
+ * @return
+ */
+ @Deprecated
+ public boolean isRequiresTransitiveDependencies() {
+ return localDependenciesTransitive;
+ }
+
+ /**
+ * @deprecated since AS 8.x. Use {@link #setLocalDependenciesTransitive(boolean)} instead
+ * @param requiresTransitiveDependencies
+ */
+ @Deprecated
+ public void setRequiresTransitiveDependencies(final boolean requiresTransitiveDependencies) {
+ this.localDependenciesTransitive = requiresTransitiveDependencies;
+ }
+
public boolean isLocalLast() {
return localLast;
}
|
AS7-<I> Deprecate the methods on ModuleSpecification instead of removing those
|
diff --git a/classes/Kohana/Jam/Model.php b/classes/Kohana/Jam/Model.php
index <HASH>..<HASH> 100755
--- a/classes/Kohana/Jam/Model.php
+++ b/classes/Kohana/Jam/Model.php
@@ -397,7 +397,7 @@ abstract class Kohana_Jam_Model extends Jam_Validated {
public function get_insist($attribute_name)
{
- $attribute = $this->{$attribute_name};
+ $attribute = $this->__get($attribute_name);
if ($attribute === NULL)
throw new Jam_Exception_Notfound('The association :name was empty on :model', NULL, array(
|
a small performance optimization for get_insist
|
diff --git a/src/Geometry.php b/src/Geometry.php
index <HASH>..<HASH> 100644
--- a/src/Geometry.php
+++ b/src/Geometry.php
@@ -237,7 +237,13 @@ abstract class Geometry
*/
public function asText()
{
- return (new WKTWriter())->write($this);
+ static $wktWriter;
+
+ if ($wktWriter === null) {
+ $wktWriter = new WKTWriter();
+ }
+
+ return $wktWriter->write($this);
}
/**
@@ -249,7 +255,13 @@ abstract class Geometry
*/
public function asBinary()
{
- return (new WKBWriter())->write($this);
+ static $wkbWriter;
+
+ if ($wkbWriter === null) {
+ $wkbWriter = new WKBWriter();
+ }
+
+ return $wkbWriter->write($this);
}
/**
|
Static instances of WKTWriter and WKBWriter in Geometry export methods
|
diff --git a/app/adapters/application.js b/app/adapters/application.js
index <HASH>..<HASH> 100644
--- a/app/adapters/application.js
+++ b/app/adapters/application.js
@@ -95,6 +95,10 @@ export default Adapter.extend(PouchAdapterUtils, {
return haveSpecialCharacters;
},
+ generateIdForRecord: function() {
+ return PouchDB.utils.uuid();
+ },
+
findQuery: function(store, type, query, options) {
var specialQuery = false;
for (var i = 0; i < this._specialQueries.length; i++) {
|
Make sure new records have id on creation.
|
diff --git a/src/Provider/Hook_Event_Provider.php b/src/Provider/Hook_Event_Provider.php
index <HASH>..<HASH> 100644
--- a/src/Provider/Hook_Event_Provider.php
+++ b/src/Provider/Hook_Event_Provider.php
@@ -20,6 +20,8 @@ class Hook_Event_Provider implements ServiceProviderInterface {
/**
* @param Container $pimple Container instance.
+ *
+ * @psalm-suppress DeprecatedClass
*/
public function register( Container $pimple ): void {
|
Disabled Psalm error for known deprecated class use.
|
diff --git a/src/Torann/LaravelRepository/Repositories/AbstractCacheDecorator.php b/src/Torann/LaravelRepository/Repositories/AbstractCacheDecorator.php
index <HASH>..<HASH> 100644
--- a/src/Torann/LaravelRepository/Repositories/AbstractCacheDecorator.php
+++ b/src/Torann/LaravelRepository/Repositories/AbstractCacheDecorator.php
@@ -239,6 +239,12 @@ abstract class AbstractCacheDecorator implements RepositoryInterface
*/
public function getCacheKey($method, $args = null)
{
+ foreach($args as &$a) {
+ if ($a instanceof Model) {
+ $a = get_class($a).'|'.$a->getKey();
+ }
+ }
+
$args = serialize($args)
. serialize($this->repo->getScopeQuery())
. serialize($this->repo->getWith());
@@ -304,4 +310,4 @@ abstract class AbstractCacheDecorator implements RepositoryInterface
{
return call_user_func_array([$this->repo, $method], $parameters);
}
-}
\ No newline at end of file
+}
|
Enable closures with model arguments.
An Exception is thrown if you use the Model typehint / type as an argument(s) in your repository methods, a pretty common practice. `Serialization of 'Closure' is not allowed` There may be a more clever way to support more types of objects, but this was fast, easy and worked for my purposes.
|
diff --git a/connection.go b/connection.go
index <HASH>..<HASH> 100644
--- a/connection.go
+++ b/connection.go
@@ -6,7 +6,6 @@ import (
"errors"
"fmt"
"io"
- "log"
"math/rand"
"net"
"strconv"
@@ -14,6 +13,8 @@ import (
"sync"
"time"
+ "github.com/anacrolix/log"
+
"github.com/anacrolix/missinggo"
"github.com/anacrolix/missinggo/bitmap"
"github.com/anacrolix/missinggo/iter"
@@ -1203,7 +1204,7 @@ another:
break another
}
}
- log.Printf("error sending chunk %+v to peer: %s", r, err)
+ log.Str("error sending chunk to peer").AddValues(c, r, err).Log(c.t.logger)
// If we failed to send a chunk, choke the peer to ensure they
// flush all their requests. We've probably dropped a piece,
// but there's no way to communicate this to the peer. If they
|
Use new logging in connection.go
|
diff --git a/src/itertools/autoload.php b/src/itertools/autoload.php
index <HASH>..<HASH> 100644
--- a/src/itertools/autoload.php
+++ b/src/itertools/autoload.php
@@ -17,6 +17,7 @@ spl_autoload_register(function ($class) {
'itertools\ForkingIterator',
'itertools\HistoryIterator',
'itertools\IterUtil',
+ 'itertools\LockingIterator',
'itertools\MapIterator',
'itertools\PdoIterator',
'itertools\Queue',
|
Added LockingIterator to autoload
|
diff --git a/lib/Elastica/Query/Ids.php b/lib/Elastica/Query/Ids.php
index <HASH>..<HASH> 100644
--- a/lib/Elastica/Query/Ids.php
+++ b/lib/Elastica/Query/Ids.php
@@ -6,7 +6,7 @@
* @category Xodoa
* @package Elastica
* @author Lee Parker, Nicolas Ruflin <spam@ruflin.com>, Tim Rupp
- * @link http://www.elasticsearch.org/guide/reference/query-dsl/ids-filter.html
+ * @link http://www.elasticsearch.org/guide/reference/query-dsl/ids-query.html
*/
class Elastica_Query_Ids extends Elastica_Query_Abstract
{
|
Fixed link to elasticsearch documentation for Query_Ids
|
diff --git a/werkzeug/testsuite/formparser.py b/werkzeug/testsuite/formparser.py
index <HASH>..<HASH> 100644
--- a/werkzeug/testsuite/formparser.py
+++ b/werkzeug/testsuite/formparser.py
@@ -132,6 +132,8 @@ class FormParserTestCase(WerkzeugTestCase):
# make sure we have a real file here, because we expect to be
# on the disk. > 1024 * 500
self.assert_true(hasattr(req.files['foo'].stream, u'fileno'))
+ # close file to prevent fds from leaking
+ req.files['foo'].close()
def test_streaming_parse(self):
data = b'x' * (1024 * 600)
|
Close file to prevent leaking fd
|
diff --git a/spec/unit/mongoid/config_spec.rb b/spec/unit/mongoid/config_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/mongoid/config_spec.rb
+++ b/spec/unit/mongoid/config_spec.rb
@@ -1,13 +1,12 @@
require "spec_helper"
describe Mongoid::Config do
+ let(:config) { Mongoid::Config.instance }
after do
- Mongoid::Config.instance.reset
+ config.reset
end
- let(:config) { Mongoid::Config.instance }
-
describe "#database=" do
context "when object provided is not a Mongo::DB" do
diff --git a/spec/unit/mongoid_spec.rb b/spec/unit/mongoid_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/mongoid_spec.rb
+++ b/spec/unit/mongoid_spec.rb
@@ -32,14 +32,14 @@ describe Mongoid do
end
describe ".deprecate" do
+ let(:deprecation) { stub }
before do
- @deprecation = mock
- Mongoid::Deprecation.expects(:instance).returns(@deprecation)
+ Mongoid::Deprecation.expects(:instance).returns(deprecation)
end
it "calls alert on the deprecation singleton" do
- @deprecation.expects(:alert).with("testing")
+ deprecation.expects(:alert).with("testing")
Mongoid.deprecate("testing")
end
end
|
Specfix for better use of rspec
|
diff --git a/webpack.config.js b/webpack.config.js
index <HASH>..<HASH> 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -16,16 +16,6 @@ if (process.env.COMPRESS) {
);
}
-if (process.env.COMPRESS) {
- plugins.push(
- new webpack.optimize.UglifyJsPlugin({
- compressor: {
- warnings: false
- }
- })
- );
-}
-
module.exports = {
output: {
library: 'Potion',
|
remove duplicate lines in webpack config
|
diff --git a/src/emailjs-imap-client.js b/src/emailjs-imap-client.js
index <HASH>..<HASH> 100644
--- a/src/emailjs-imap-client.js
+++ b/src/emailjs-imap-client.js
@@ -1828,7 +1828,7 @@
};
};
- var logger = this.options.logger || createLogger(this.logLevel, "emailjs-imap-client@" + this.options.sessionId);
+ var logger = this.options.logger || createLogger(this.options.sessionId || 1);
this.logger = this.client.logger = {
// this could become way nicer when node supports the rest operator...
debug: function() {
|
sessionId missing from logs
It is vital too see which session owns each log when connected to
more than one server
|
diff --git a/hearthstone/cardxml.py b/hearthstone/cardxml.py
index <HASH>..<HASH> 100644
--- a/hearthstone/cardxml.py
+++ b/hearthstone/cardxml.py
@@ -151,10 +151,9 @@ class CardXML(object):
for tag in STRING_TAGS:
value = self.strings[tag]
if value:
- ElementTree.SubElement(
- ret, "Tag", enumID=str(int(tag)), name=tag.name,
- type="String", value=str(value)
- )
+ e = ElementTree.SubElement(ret, "Tag", enumID=str(int(tag)), name=tag.name)
+ e.attrib["type"] = "String"
+ e.text = value
for tag, value in sorted(self.tags.items()):
e = ElementTree.SubElement(ret, "Tag", enumID=str(int(tag)))
|
cardxml: Write string tag contents as text rather than attribute
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@ with open('./README.rst') as f:
setup(
- version="10.2.0",
+ version="10.2.0rc1",
name="swimlane",
author="Swimlane",
author_email="info@swimlane.com",
|
change <I> to rc tag (#<I>)
|
diff --git a/ceph_deploy/hosts/suse/uninstall.py b/ceph_deploy/hosts/suse/uninstall.py
index <HASH>..<HASH> 100644
--- a/ceph_deploy/hosts/suse/uninstall.py
+++ b/ceph_deploy/hosts/suse/uninstall.py
@@ -7,7 +7,7 @@ def uninstall(conn, purge=False):
'libcephfs1',
'librados2',
'librbd1',
- 'radosgw',
+ 'ceph-radosgw',
]
cmd = [
'zypper',
|
suse.uninstall: ceph-deploy purge fails on SUSE.
This is because ceph-deploy tries to remove a package that does not exist.
To fix this we need to change package name to correct name ceph-radosgw
from the old name radosgw.
|
diff --git a/code/media/com_files/js/files.app.js b/code/media/com_files/js/files.app.js
index <HASH>..<HASH> 100644
--- a/code/media/com_files/js/files.app.js
+++ b/code/media/com_files/js/files.app.js
@@ -65,6 +65,9 @@ Files.App = new Class({
clearTimeout(delay);
delay = this.setDimensions.delay(200, this);
}.bind(this));
+ this.grid.addEvent('onAfterRenew', function(){
+ this.setDimensions(true);
+ }.bind(this));
}
},
|
re #<I> thumbnail size forgotten when switching between grid and list layouts
|
diff --git a/core/Common.php b/core/Common.php
index <HASH>..<HASH> 100644
--- a/core/Common.php
+++ b/core/Common.php
@@ -85,7 +85,6 @@ class Piwik_Common
if(defined('PIWIK_TRACKER_MODE')
&& PIWIK_TRACKER_MODE)
{
- Zend_Registry::set('db', Piwik_Tracker::getDatabase());
//TODO we can remove these includes when #620 is done
require_once "Zend/Exception.php";
require_once "Zend/Loader.php";
@@ -107,7 +106,9 @@ class Piwik_Common
require_once "Option.php";
require_once "View.php";
require_once "UpdateCheck.php";
+ Zend_Registry::set('db', Piwik_Tracker::getDatabase());
Piwik::createAccessObject();
+ Piwik::createConfigObject();
Piwik::setUserIsSuperUser();
$pluginsManager = Piwik_PluginsManager::getInstance();
$pluginsManager->setPluginsToLoad( Zend_Registry::get('config')->Plugins->Plugins->toArray() );
|
- fixed #<I> due to wrong order in includes when regenerating cache file in piwik.php
git-svn-id: <URL>
|
diff --git a/rails/init.rb b/rails/init.rb
index <HASH>..<HASH> 100644
--- a/rails/init.rb
+++ b/rails/init.rb
@@ -7,9 +7,9 @@ module Timely
def weekdays_field(attribute, options={})
db_field = options[:db_field] || attribute.to_s + '_bit_array'
self.composed_of(attribute,
- :class_name => "Timely::WeekDays",
+ :class_name => "::Timely::WeekDays",
:mapping => [[db_field, 'weekdays_int']],
- :converter => Proc.new {|field| Timely::WeekDays.new(field)}
+ :converter => Proc.new {|field| ::Timely::WeekDays.new(field)}
)
end
end
|
Fixes NameError (uninitialized constant Rails::Plugin::Timely::WeekDays)
|
diff --git a/lib/bibformatadminlib.py b/lib/bibformatadminlib.py
index <HASH>..<HASH> 100644
--- a/lib/bibformatadminlib.py
+++ b/lib/bibformatadminlib.py
@@ -156,6 +156,11 @@ def perform_request_format_template_show(bft, ln=cdslang, code=None,
# Look for all existing content_types
content_types = bibformat_dblayer.get_existing_content_types()
+ # Add some standard content types if not already there
+ standard_content_types = ['text/xml', 'application/rss+xml', 'text/plain', 'text/html']
+ content_types.extend([content_type for content_type in standard_content_types
+ if content_type not in content_types])
+
return bibformat_templates.tmpl_admin_format_template_show(ln, format_template['attrs']['name'],
format_template['attrs']['description'],
code, bft,
@@ -1144,7 +1149,7 @@ def get_elements_used_by_template(filename):
if not value in format_elements[function_name]['tags']:
format_elements[function_name]['tags'].append(value)
break
-
+
keys = format_elements.keys()
keys.sort()
return map(format_elements.get, keys)
|
Added more content-types by default in content-types list for preview.
|
diff --git a/app/config/bootstrap/media.php b/app/config/bootstrap/media.php
index <HASH>..<HASH> 100644
--- a/app/config/bootstrap/media.php
+++ b/app/config/bootstrap/media.php
@@ -39,7 +39,8 @@ Collection::formats('lithium\net\http\Media');
// use lithium\net\http\Media;
//
// Dispatcher::applyFilter('_callable', function($self, $params, $chain) {
-// list($library, $asset) = explode('/', $params['request']->url, 2) + array("", "");
+// $url = ltrim($params['request']->url, '/');
+// list($library, $asset) = explode('/', $url, 2) + array("", "");
//
// if ($asset && ($path = Media::webroot($library)) && file_exists($file = "{$path}/{$asset}")) {
// return function() use ($file) {
|
Trim leading slash of request url before parsing library and asset
|
diff --git a/example/example/settings.py b/example/example/settings.py
index <HASH>..<HASH> 100644
--- a/example/example/settings.py
+++ b/example/example/settings.py
@@ -8,6 +8,8 @@ For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
+import django
+
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
@@ -28,7 +30,8 @@ ALLOWED_HOSTS = []
# Application definition
-TEST_RUNNER = 'discover_runner.DiscoverRunner'
+if django.get_version() < '1.6':
+ TEST_RUNNER = 'discover_runner.DiscoverRunner'
TRACK_PAGEVIEWS = True
GEOIP_PATH = os.path.join(BASE_DIR, 'geoip')
|
Non-sucky testrunner for pre-django<I>
|
diff --git a/lib/travis/model/build.rb b/lib/travis/model/build.rb
index <HASH>..<HASH> 100644
--- a/lib/travis/model/build.rb
+++ b/lib/travis/model/build.rb
@@ -66,7 +66,6 @@ class Build < ActiveRecord::Base
end
def next_number
- env = defined?(Rails) ? Rails.env : ENV['ENV'] || ENV['RAILS_ENV'] || 'test'
maximum(floor('number')).to_i + 1
end
|
env isn't used anywhere, so i am pretty sure it can be removed
|
diff --git a/ipyrad/assemble/refmap.py b/ipyrad/assemble/refmap.py
index <HASH>..<HASH> 100644
--- a/ipyrad/assemble/refmap.py
+++ b/ipyrad/assemble/refmap.py
@@ -81,10 +81,11 @@ def index_reference_sequence(data, force=False):
## error handling
if proc1.returncode:
raise IPyradWarningExit(error1)
- if "please use bgzip" in error2:
- raise IPyradWarningExit(NO_ZIP_BINS.format(refseq_file))
- else:
- raise IPyradWarningExit(error2)
+ if error2:
+ if "please use bgzip" in error2:
+ raise IPyradWarningExit(NO_ZIP_BINS.format(refseq_file))
+ else:
+ raise IPyradWarningExit(error2)
## print finished message
if data._headers:
|
Adjusted fix to bgzip test.
|
diff --git a/active_event/lib/active_event/domain.rb b/active_event/lib/active_event/domain.rb
index <HASH>..<HASH> 100644
--- a/active_event/lib/active_event/domain.rb
+++ b/active_event/lib/active_event/domain.rb
@@ -34,7 +34,7 @@ module ActiveEvent
base.server_uri = 'druby://127.0.0.1:8787'
end
- def set_config(protocol: 'druby', host: 'localhost', port: 8787)
+ def set_config(protocol = 'druby', host = 'localhost', port = 8787)
self.server_uri = "#{protocol}://#{host}:#{port}"
end
end
diff --git a/active_event/lib/active_event/support/attr_setter.rb b/active_event/lib/active_event/support/attr_setter.rb
index <HASH>..<HASH> 100644
--- a/active_event/lib/active_event/support/attr_setter.rb
+++ b/active_event/lib/active_event/support/attr_setter.rb
@@ -21,7 +21,7 @@ module ActiveEvent::Support
def attributes(*args)
super
args.each do |attr|
- define_method "#{attr}=", -> (value) { attributes[attr] = value }
+ define_method "#{attr}=", lambda { |value| attributes[attr] = value }
end
end
end
|
* different syntax for lambda and default args to ensure rubinius support
|
diff --git a/ryu/lib/packet/bgp.py b/ryu/lib/packet/bgp.py
index <HASH>..<HASH> 100644
--- a/ryu/lib/packet/bgp.py
+++ b/ryu/lib/packet/bgp.py
@@ -2661,11 +2661,12 @@ class _FlowSpecOperatorBase(_FlowSpecComponentBase):
return cls(operator, value), rest
def serialize_body(self):
- length = (self.value.bit_length() + 7) // 8 or 1
- self.operator |= int(math.log(length, 2)) << 4
+ byte_length = (self.value.bit_length() + 7) // 8 or 1
+ length = int(math.ceil(math.log(byte_length, 2)))
+ self.operator |= length << 4
buf = struct.pack(self._OPE_PACK_STR, self.operator)
- value_type = type_desc.IntDescr(length)
- buf += struct.pack(self._VAL_PACK_STR % length,
+ value_type = type_desc.IntDescr(1 << length)
+ buf += struct.pack(self._VAL_PACK_STR % (1 << length),
value_type.from_user(self.value))
return buf
|
packet/bgp: Properly calculate length for FlowSpec
RFC <I> says the 'len' field in numeric or bitmask operators
represents that the length of the value field is [1 << 'len'].
But, in serializing FlowSpec messages, the packet library uses
the `len` field as the length of the value field itself.
This patch fixes it to serialize FlowSpec messages properly.
|
diff --git a/src/Codeception/Lib/Connector/ZF2.php b/src/Codeception/Lib/Connector/ZF2.php
index <HASH>..<HASH> 100644
--- a/src/Codeception/Lib/Connector/ZF2.php
+++ b/src/Codeception/Lib/Connector/ZF2.php
@@ -40,6 +40,8 @@ class ZF2 extends Client
$zendRequest = $this->application->getRequest();
$zendResponse = $this->application->getResponse();
+ $zendResponse->setStatusCode(200);
+
$uri = new HttpUri($request->getUri());
$queryString = $uri->getQuery();
$method = strtoupper($request->getMethod());
|
Reset status code in ZF2 connector
|
diff --git a/lxd/device/device.go b/lxd/device/device.go
index <HASH>..<HASH> 100644
--- a/lxd/device/device.go
+++ b/lxd/device/device.go
@@ -115,6 +115,9 @@ func (d *deviceCommon) Remove() error {
}
// New instantiates a new device struct, validates the supplied config and sets it into the device.
+// If the device type is valid, but the other config validation fails then an instantiated device
+// is still returned with the validation error. If an unknown device is requested or the device is
+// not compatible with the instance type then an ErrUnsupportedDevType error is returned.
func New(instance InstanceIdentifier, state *state.State, name string, conf config.Device, volatileGet VolatileGetter, volatileSet VolatileSetter) (Device, error) {
devFunc := devTypes[conf["type"]]
@@ -132,9 +135,9 @@ func New(instance InstanceIdentifier, state *state.State, name string, conf conf
// Init the device and run validation of supplied config.
dev.init(instance, state, name, conf, volatileGet, volatileSet)
err := dev.validateConfig()
- if err != nil {
- return nil, err
- }
- return dev, nil
+ // We still return the instantiated device here, as in some scenarios the caller
+ // may still want to use the device (such as when stopping or removing) even if
+ // the config validation has failed.
+ return dev, err
}
|
device: Modifies New function to return device even if validation fails
This is so the caller can decide whether to use the device or not based on the scenario.
In cases where a new version of LXD restricts device validation such that a previously valid config is now invalid, it is useful for LXD to still be able to cleanly stop and remove the device even if validation of the old config fails.
|
diff --git a/lib/fine_print/controller_additions.rb b/lib/fine_print/controller_additions.rb
index <HASH>..<HASH> 100644
--- a/lib/fine_print/controller_additions.rb
+++ b/lib/fine_print/controller_additions.rb
@@ -30,14 +30,17 @@ module FinePrint
class_eval do
before_filter(filter_options) do |controller|
+ # If the user isn't signed in, they can't sign a contract. Since there
+ # may be some pages that logged in and non-logged in users can visit,
+ # just return quietly instead of raising an exception.
+ user = FinePrint.current_user_proc.call(self)
+ return true unless FinePrint.is_signed_in?(user)
+
contract_names = names - fine_print_skipped_contract_names
# Bail if nothing to do
return true if contract_names.blank?
- user = FinePrint.current_user_proc.call(self)
- FinePrint.raise_unless_signed_in(user)
-
unsigned_contract_names =
FinePrint.get_unsigned_contract_names(user, contract_names)
|
quietly return if user not logged in
|
diff --git a/GPy/core/model.py b/GPy/core/model.py
index <HASH>..<HASH> 100644
--- a/GPy/core/model.py
+++ b/GPy/core/model.py
@@ -76,7 +76,7 @@ class Model(Parameterized):
jobs = []
pool = mp.Pool(processes=num_processes)
for i in range(num_restarts):
- self.randomize()
+ if i>0: self.randomize()
job = pool.apply_async(opt_wrapper, args=(self,), kwds=kwargs)
jobs.append(job)
@@ -90,7 +90,7 @@ class Model(Parameterized):
for i in range(num_restarts):
try:
if not parallel:
- self.randomize()
+ if i>0: self.randomize()
self.optimize(**kwargs)
else:
self.optimization_runs.append(jobs[i].get())
|
change the behavior the optimize_restarts to keep the original model parameters for the firt run
|
diff --git a/master/buildbot/process/buildstep.py b/master/buildbot/process/buildstep.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/process/buildstep.py
+++ b/master/buildbot/process/buildstep.py
@@ -129,6 +129,8 @@ class SyncLogFileWrapper(logobserver.LogObserver):
self.finished = False
self.finishDeferreds = []
+ self.step._sync_addlog_deferreds.append(addLogDeferred)
+
@addLogDeferred.addCallback
def gotAsync(log):
self.asyncLogfile = log
@@ -537,6 +539,7 @@ class BuildStep(results.ResultComputingConfigMixin,
def run(self):
self._start_deferred = defer.Deferred()
unhandled = self._start_unhandled_deferreds = []
+ self._sync_addlog_deferreds = []
try:
# here's where we set things up for backward compatibility for
# old-style steps, using monkey patches so that new-style steps
@@ -571,6 +574,9 @@ class BuildStep(results.ResultComputingConfigMixin,
self._start_deferred.callback(results)
results = yield self._start_deferred
finally:
+ # wait all the sync logs have been actually created before finishing
+ yield defer.DeferredList(self._sync_addlog_deferreds,
+ consumeErrors=True)
self._start_deferred = None
unhandled = self._start_unhandled_deferreds
self._start_unhandled_deferreds = None
|
wait for the logs are created before finishing the step
There is a race condition between addLogs calls, and the end of the step.
for oldStyleSteps, this matters, because the subsequent addStderr, are only called
at the end of the step, so we must wait for log are created before continuing
|
diff --git a/lib/couchrest/validation/validators/required_field_validator.rb b/lib/couchrest/validation/validators/required_field_validator.rb
index <HASH>..<HASH> 100644
--- a/lib/couchrest/validation/validators/required_field_validator.rb
+++ b/lib/couchrest/validation/validators/required_field_validator.rb
@@ -37,7 +37,7 @@ module CouchRest
def call(target)
value = target.validation_property_value(field_name)
- property = target.validation_property(field_name)
+ property = target.validation_property(field_name.to_s)
return true if present?(value, property)
error_message = @options[:message] || default_error(property)
@@ -66,7 +66,7 @@ module CouchRest
# Returns false for other property types.
# Returns false for non-properties.
def boolean_type?(property)
- property ? property.type == TrueClass : false
+ property ? property.type == 'Boolean' : false
end
end # class RequiredFieldValidator
|
Fixed required_field_validator to behave correctly with boolean fields
|
diff --git a/db/ActiveSearchTrait.php b/db/ActiveSearchTrait.php
index <HASH>..<HASH> 100644
--- a/db/ActiveSearchTrait.php
+++ b/db/ActiveSearchTrait.php
@@ -183,7 +183,9 @@ trait ActiveSearchTrait
$subquery = (new Query)
->select(array_keys($relation->link))
->from(['t' => $relationClass::tableName()])
- ->where(['IN', $relationClass::primaryKey(), $value]);
+ ->where(['IN', array_map(function ($key) {
+ return 't.' . $key;
+ }, $relationClass::primaryKey()), $value]);
$linkKeys = array_values($relation->link);
}
return ['IN', $linkKeys, $subquery];
|
fix relation search by adding prefix to pk
|
diff --git a/pysc2/lib/sc_process.py b/pysc2/lib/sc_process.py
index <HASH>..<HASH> 100644
--- a/pysc2/lib/sc_process.py
+++ b/pysc2/lib/sc_process.py
@@ -61,10 +61,10 @@ class StarcraftProcess(object):
host="127.0.0.1", connect=True, timeout_seconds=None, **kwargs):
self._proc = None
self._controller = None
+ self._check_exists(exec_path)
self._tmp_dir = tempfile.mkdtemp(prefix="sc-", dir=run_config.tmp_dir)
self._host = host
self._port = portpicker.pick_unused_port()
- self._check_exists(exec_path)
args = [
exec_path,
@@ -102,7 +102,7 @@ class StarcraftProcess(object):
if hasattr(self, "_port") and self._port:
portpicker.return_port(self._port)
self._port = None
- if os.path.exists(self._tmp_dir):
+ if hasattr(self, "_tmp_dir") and os.path.exists(self._tmp_dir):
shutil.rmtree(self._tmp_dir)
@property
|
Fail early if the binary doesn't exist.
PiperOrigin-RevId: <I>
|
diff --git a/spec/controllers/api/systems_packages_controller_spec.rb b/spec/controllers/api/systems_packages_controller_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/controllers/api/systems_packages_controller_spec.rb
+++ b/spec/controllers/api/systems_packages_controller_spec.rb
@@ -41,7 +41,7 @@ describe Api::SystemPackagesController do
@organization = Organization.create!(:name => 'test_org', :cp_key => 'test_org')
@environment_1 = KTEnvironment.create!(:name => 'test_1', :prior => @organization.locker.id, :organization => @organization)
- @system = System.create!(:environment => @environment_1, :uuid => "1234", :name => "system.example.com", :cp_type => 'system', :facts => {})
+ @system = System.create!(:environment => @environment_1, :uuid => "1234", :name => "system.example.com", :cp_type => 'system', :facts => {:foo => :bar})
System.stub(:first => @system)
end
|
Temporary fix for jenkins errors
|
diff --git a/ui/app/products/components/pnc-products-data-table/pncProductsDataTable.js b/ui/app/products/components/pnc-products-data-table/pncProductsDataTable.js
index <HASH>..<HASH> 100644
--- a/ui/app/products/components/pnc-products-data-table/pncProductsDataTable.js
+++ b/ui/app/products/components/pnc-products-data-table/pncProductsDataTable.js
@@ -50,6 +50,12 @@
title: 'Name',
placeholder: 'Filter by Name',
filterType: 'text'
+ },
+ {
+ id: 'abbreviation',
+ title: 'Abbreviation',
+ placeholder: 'Filter by abbreviation',
+ filterType: 'text'
}
];
|
[NCL-<I>] Add abbreviation filter option to product list page
|
diff --git a/docs/source/conf.py b/docs/source/conf.py
index <HASH>..<HASH> 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -55,7 +55,7 @@ repo_name = u"dtoolcore"
# built documents.
#
# The short X.Y version.
-version = u"2.7.0"
+version = u"2.8.0"
# The full version, including alpha/beta/rc tags.
release = version
diff --git a/dtoolcore/__init__.py b/dtoolcore/__init__.py
index <HASH>..<HASH> 100644
--- a/dtoolcore/__init__.py
+++ b/dtoolcore/__init__.py
@@ -16,7 +16,7 @@ except ImportError:
import dtoolcore.utils
-__version__ = "2.7.0"
+__version__ = "2.8.0"
def _generate_storage_broker_lookup():
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
from setuptools import setup
-version = "2.7.0"
+version = "2.8.0"
url = "https://github.com/jic-dtool/dtoolcore"
readme = open('README.rst').read()
|
Update version number to <I>
|
diff --git a/lib/plugins/package/lib/zipService.js b/lib/plugins/package/lib/zipService.js
index <HASH>..<HASH> 100644
--- a/lib/plugins/package/lib/zipService.js
+++ b/lib/plugins/package/lib/zipService.js
@@ -1,5 +1,6 @@
'use strict';
+const { ServerlessError } = require('../../../classes/Error');
const BbPromise = require('bluebird');
const archiver = require('archiver');
const os = require('os');
@@ -120,11 +121,16 @@ module.exports = {
// Get file contents and stat in parallel
this.getFileContent(fullPath),
fs.statAsync(fullPath),
- ]).then(result => ({
- data: result[0],
- stat: result[1],
- filePath,
- }));
+ ]).then(
+ result => ({
+ data: result[0],
+ stat: result[1],
+ filePath,
+ }),
+ error => {
+ throw new ServerlessError(`Cannot read file ${filePath} due to: ${error.message}`);
+ }
+ );
},
// Useful point of entry for e.g. transpilation plugins
|
fix(Packaging): Expose meaningfully file access errors (#<I>)
|
diff --git a/lib/shared/adapters/test_unit_adapter.rb b/lib/shared/adapters/test_unit_adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/shared/adapters/test_unit_adapter.rb
+++ b/lib/shared/adapters/test_unit_adapter.rb
@@ -4,7 +4,7 @@ class TestUnitAdapter
def self.command(project_path, ruby_interpreter, files)
ruby_command = RubyEnv.ruby_command(project_path, :ruby_interpreter => ruby_interpreter)
- "#{ruby_command} -Itest -e '%w(#{files}).each { |file| require(file) }'"
+ %{#{ruby_command} -Itest -e '%w(#{files}).each { |file| require("#{Dir.pwd}/#{file}") }'}
end
def self.test_files(dir)
|
Use full path with test unit files to support ruby <I>.
|
diff --git a/presto-main/src/main/java/com/facebook/presto/server/ThreadResource.java b/presto-main/src/main/java/com/facebook/presto/server/ThreadResource.java
index <HASH>..<HASH> 100644
--- a/presto-main/src/main/java/com/facebook/presto/server/ThreadResource.java
+++ b/presto-main/src/main/java/com/facebook/presto/server/ThreadResource.java
@@ -43,6 +43,9 @@ public class ThreadResource
ImmutableList.Builder<Info> builder = ImmutableList.builder();
for (ThreadInfo info : mbean.getThreadInfo(mbean.getAllThreadIds(), Integer.MAX_VALUE)) {
+ if (info == null) {
+ continue;
+ }
builder.add(new Info(
info.getThreadId(),
info.getThreadName(),
|
fix for thread listing under heavy workloads
|
diff --git a/upload/admin/controller/marketplace/cron.php b/upload/admin/controller/marketplace/cron.php
index <HASH>..<HASH> 100644
--- a/upload/admin/controller/marketplace/cron.php
+++ b/upload/admin/controller/marketplace/cron.php
@@ -61,7 +61,7 @@ class Cron extends \Opencart\System\Engine\Controller {
}
if (isset($this->request->get['page'])) {
- $page = $this->request->get['page'];
+ $page = (int)$this->request->get['page'];
} else {
$page = 1;
}
@@ -279,4 +279,4 @@ class Cron extends \Opencart\System\Engine\Controller {
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
-}
\ No newline at end of file
+}
|
Added integer on $page get request.
|
diff --git a/script/check-MakeGitError-thread-lock.go b/script/check-MakeGitError-thread-lock.go
index <HASH>..<HASH> 100644
--- a/script/check-MakeGitError-thread-lock.go
+++ b/script/check-MakeGitError-thread-lock.go
@@ -9,6 +9,8 @@ import (
"go/printer"
"go/token"
"log"
+ "os"
+ "path/filepath"
"strings"
)
@@ -24,7 +26,7 @@ func main() {
log.Fatal(err)
}
- pkgs, err := parser.ParseDir(fset, bpkg.Dir, nil, 0)
+ pkgs, err := parser.ParseDir(fset, bpkg.Dir, func(fi os.FileInfo) bool { return filepath.Ext(fi.Name()) == ".go" }, 0)
if err != nil {
log.Fatal(err)
}
|
only check Go source files for non-thread-locked MakeGitError calls
|
diff --git a/src/playbacks/html5_video/html5_video.js b/src/playbacks/html5_video/html5_video.js
index <HASH>..<HASH> 100644
--- a/src/playbacks/html5_video/html5_video.js
+++ b/src/playbacks/html5_video/html5_video.js
@@ -169,7 +169,7 @@ class HTML5Video extends Playback {
this.$el.html(this.template({ src: this.src, type: this.typeFor(this.src) }))
this.$el.append(style)
this.trigger('playback:ready', this.name)
- this.options.autoPlay && this.play()
+ process.nextTick(() => this.options.autoPlay && this.play())
return this
}
}
|
html5 video: fix autoplay not working correctly on safari (closes #<I>)
|
diff --git a/test/utils/TestDateTime.java b/test/utils/TestDateTime.java
index <HASH>..<HASH> 100644
--- a/test/utils/TestDateTime.java
+++ b/test/utils/TestDateTime.java
@@ -71,6 +71,12 @@ public final class TestDateTime {
}
@Test
+ public void parseDateTimeStringNow() {
+ long t = DateTime.parseDateTimeString("now", null);
+ assertEquals(t, 1357300800000L);
+ }
+
+ @Test
public void parseDateTimeStringRelativeS() {
long t = DateTime.parseDateTimeString("60s-ago", null);
assertEquals(60000, (System.currentTimeMillis() - t));
|
Added test for Now timestamp
Fixes #<I>
|
diff --git a/satpy/readers/abi_l1b.py b/satpy/readers/abi_l1b.py
index <HASH>..<HASH> 100644
--- a/satpy/readers/abi_l1b.py
+++ b/satpy/readers/abi_l1b.py
@@ -96,10 +96,11 @@ class NC_ABI_L1B(BaseFileHandler):
lon_0 = projection.attrs['longitude_of_projection_origin'][...]
sweep_axis = projection.attrs['sweep_angle_axis'][0]
- scale_x = self.nc['x'].attrs["scale_factor"][0]
- scale_y = self.nc['y'].attrs["scale_factor"][0]
- offset_x = self.nc['x'].attrs["add_offset"][0]
- offset_y = self.nc['y'].attrs["add_offset"][0]
+ # need 64-bit floats otherwise small shift
+ scale_x = np.float64(self.nc['x'].attrs["scale_factor"][0])
+ scale_y = np.float64(self.nc['y'].attrs["scale_factor"][0])
+ offset_x = np.float64(self.nc['x'].attrs["add_offset"][0])
+ offset_y = np.float64(self.nc['y'].attrs["add_offset"][0])
# x and y extents in m
h = float(h)
|
Update ABI scale factors to be <I>-bit floats to improve X/Y calculations
In other applications I have noticed that the in-file <I>-bit
factor and offset produce a noticeable drift in the per-pixel X/Y
values. When converted to <I>-bit to force <I>-bit arithmetic the results
are closer to the advertised pixel resolution of the instrument.
|
diff --git a/spyderlib/widgets/explorer.py b/spyderlib/widgets/explorer.py
index <HASH>..<HASH> 100644
--- a/spyderlib/widgets/explorer.py
+++ b/spyderlib/widgets/explorer.py
@@ -395,8 +395,11 @@ class ExplorerTreeWidget(DirView):
path, valid = QInputDialog.getText(self,
translate('Explorer', 'Rename'),
translate('Explorer', 'New name:'),
- QLineEdit.Normal, fname)
- if valid and path != fname:
+ QLineEdit.Normal, osp.basename(fname))
+ if valid:
+ path = osp.join(osp.dirname(fname), unicode(path))
+ if path == fname:
+ return
try:
os.rename(fname, path)
self.parent_widget.emit(SIGNAL("renamed(QString,QString)"),
@@ -409,9 +412,7 @@ class ExplorerTreeWidget(DirView):
"<br><br>Error message:<br>%1") \
.arg(str(error)))
finally:
- selected_row = self.currentRow()
- self.refresh()
- self.setCurrentRow(selected_row)
+ self.refresh_folder(osp.dirname(fname))
def new_folder(self):
"""Create a new folder"""
|
File explorer widget: fixed "Rename" feature
|
diff --git a/lib/mauth/client.rb b/lib/mauth/client.rb
index <HASH>..<HASH> 100644
--- a/lib/mauth/client.rb
+++ b/lib/mauth/client.rb
@@ -7,6 +7,23 @@ require 'mauth/core_ext'
require 'mauth/autoload'
module MAuth
+ class Client
+ class << self
+ # the root of the MAuth-Client library
+ def root
+ File.expand_path('../..', File.dirname(__FILE__))
+ end
+
+ # the MAuth::Client library's current version
+ def version
+ version_file = File.join(root, 'VERSION')
+ File.exists?(version_file) ? File.read(version_file).chomp : "?"
+ end
+ end
+ end
+end
+
+module MAuth
# mAuth client was unable to verify the authenticity of a signed object (this does NOT mean the
# object is inauthentic). typically due to a failure communicating with the mAuth service, in
# which case the error may include the attribute mauth_service_response - a response from
|
add MAuth::Client.version and, assisting that, MAuth::Client.root
|
diff --git a/src/tools/Fsck.java b/src/tools/Fsck.java
index <HASH>..<HASH> 100644
--- a/src/tools/Fsck.java
+++ b/src/tools/Fsck.java
@@ -144,6 +144,8 @@ final class Fsck {
final StringBuilder buf = new StringBuilder();
for (final Query query : queries) {
final long start_time = System.nanoTime();
+ long ping_start_time = start_time;
+ LOG.info("Starting to fsck data covered by " + query);
long kvcount = 0;
long rowcount = 0;
final Bytes.ByteMap<Seen> seen = new Bytes.ByteMap<Seen>();
@@ -166,6 +168,13 @@ final class Fsck {
}
for (final KeyValue kv : row) {
kvcount++;
+ if (kvcount % 100000 == 0) {
+ final long now = System.nanoTime();
+ ping_start_time = (now - ping_start_time) / 1000000;
+ LOG.info("... " + kvcount + " KV analyzed in " + ping_start_time
+ + "ms (" + (100000 * 1000 / ping_start_time) + " KVs/s)");
+ ping_start_time = now;
+ }
if (kv.qualifier().length != 2) {
LOG.warn("Ignoring unsupported KV with a qualifier of "
+ kv.qualifier().length + " bytes:" + kv);
|
fsck: Provide more feedback on how much progress is made.
Change-Id: Ib<I>dce<I>e3cadf5f<I>b<I>bab5e4c<I>a0
|
diff --git a/treeCl/distance_matrix.py b/treeCl/distance_matrix.py
index <HASH>..<HASH> 100644
--- a/treeCl/distance_matrix.py
+++ b/treeCl/distance_matrix.py
@@ -78,7 +78,7 @@ class DistanceMatrix(np.ndarray):
add_noise=False,
normalise=False,
distribute_tasks=False,
- **kwargs, # i.e. batch_size
+ **kwargs
):
if distribute_tasks:
diff --git a/treeCl/parameters.py b/treeCl/parameters.py
index <HASH>..<HASH> 100644
--- a/treeCl/parameters.py
+++ b/treeCl/parameters.py
@@ -11,6 +11,14 @@ class BaseParameters(object):
def dict(self):
return dict((item.lstrip('_'), getattr(self, item)) for item in self.__slots__)
+ def read(self, fileobj):
+ return json.load(fileobj)
+
+ def construct_from_dict(self, dict):
+ for k, v in dict.items():
+ if '_{}'.format(k) in self.__slots__:
+ setattr(self, k, v)
+
def write(self, fileobj=sys.stdout, indent=None):
json.dump(self.dict, fileobj, indent=indent)
|
Batch simulation (async and seqntl)
|
diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -70,7 +70,7 @@ gulp.task('docList', ['gitBranch'], (done) => {
/**
* Generate API documentation for all js files, place markup in the correct folder for readthedocs.org
*/
-gulp.task('docs', ['gitBranch', 'lintExterns', 'docList'], function (done) {
+gulp.task('docs', ['gitBranch', 'lintExterns', 'docList'], (done) => {
// Abort(successfully) early if running in CI and not job #1
if (!runDocs) {
return done();
|
More lambda
I really am just fiddling now
|
diff --git a/eZ/Publish/Core/MVC/Symfony/Controller/Content/ViewController.php b/eZ/Publish/Core/MVC/Symfony/Controller/Content/ViewController.php
index <HASH>..<HASH> 100644
--- a/eZ/Publish/Core/MVC/Symfony/Controller/Content/ViewController.php
+++ b/eZ/Publish/Core/MVC/Symfony/Controller/Content/ViewController.php
@@ -9,6 +9,7 @@
namespace eZ\Publish\Core\MVC\Symfony\Controller\Content;
+use eZ\Publish\API\Repository\Values\Content\Location;
use eZ\Publish\Core\MVC\Symfony\Controller\Controller;
use eZ\Publish\Core\MVC\Symfony\View\Manager as ViewManager;
use eZ\Publish\Core\MVC\Symfony\MVCEvents;
@@ -96,10 +97,19 @@ class ViewController extends Controller
try
{
+ if ( isset( $params['location'] ) && $params['location'] instanceof Location )
+ {
+ $location = $params['location'];
+ }
+ else
+ {
+ $location = $this->getRepository()->getLocationService()->loadLocation( $locationId );
+ }
+
$response->headers->set( 'X-Location-Id', $locationId );
$response->setContent(
$this->renderLocation(
- $this->getRepository()->getLocationService()->loadLocation( $locationId ),
+ $location,
$viewType,
$layout,
$params
|
EZP-<I>: Made it possible to pass a Location object in $params in ViewController
|
diff --git a/js/ascendex.js b/js/ascendex.js
index <HASH>..<HASH> 100644
--- a/js/ascendex.js
+++ b/js/ascendex.js
@@ -1831,8 +1831,21 @@ module.exports = class ascendex extends Exchange {
}
safeNetwork (networkId) {
- // TODO: parse network
- return networkId;
+ const networksById = {
+ 'TRC20': 'TRC20',
+ 'ERC20': 'ERC20',
+ 'GO20': 'GO20',
+ 'BEP2': 'BEP2',
+ 'BEP20 (BSC)': 'BEP20',
+ 'Bitcoin': 'BTC',
+ 'Bitcoin ABC': 'BCH',
+ 'Litecoin': 'LTC',
+ 'Matic Network': 'MATIC',
+ 'Solana': 'SOL',
+ 'xDai': 'STAKE',
+ 'Akash': 'AKT',
+ };
+ return this.safeString (networksById, networkId, networkId);
}
async fetchDepositAddress (code, params = {}) {
|
Completed Ascendex SafeNetwork TODO
|
diff --git a/alarmdecoder/decoder.py b/alarmdecoder/decoder.py
index <HASH>..<HASH> 100644
--- a/alarmdecoder/decoder.py
+++ b/alarmdecoder/decoder.py
@@ -213,13 +213,13 @@ class AlarmDecoder(object):
"""
if self._device:
- self._device.write(data)
+ self._device.write(str.encode(data))
def get_config(self):
"""
Retrieves the configuration from the device. Called automatically by :py:meth:`_on_open`.
"""
- self.send(b"C\r")
+ self.send("C\r")
def save_config(self):
"""
|
Fixed string encoding used with send.
|
diff --git a/acceptancetests/assess_upgrade_series.py b/acceptancetests/assess_upgrade_series.py
index <HASH>..<HASH> 100755
--- a/acceptancetests/assess_upgrade_series.py
+++ b/acceptancetests/assess_upgrade_series.py
@@ -39,7 +39,6 @@ def assess_juju_upgrade_series(client, args):
reboot_machine(client, target_machine)
upgrade_series_complete(client, target_machine)
assert_correct_series(client, target_machine, args.to_series)
- set_application_series(client, "dummy-subordinate", args.to_series)
def upgrade_series_prepare(client, machine, series, **flags):
@@ -72,10 +71,6 @@ def reboot_machine(client, machine):
log.info("wait_for_started()")
client.wait_for_started()
-def set_application_series(client, application, series):
- args = (application, series)
- client.juju('set-series', args)
-
def assert_correct_series(client, machine, expected):
"""Verify that juju knows the correct series for the machine"""
|
Removes set_application_series command from assess_upgrade_series test.
|
diff --git a/src/Towel/Model/BaseModel.php b/src/Towel/Model/BaseModel.php
index <HASH>..<HASH> 100755
--- a/src/Towel/Model/BaseModel.php
+++ b/src/Towel/Model/BaseModel.php
@@ -320,21 +320,15 @@ class BaseModel extends \Towel\BaseApp
* Finds a Record by Id. Returns the record array and sets the internal
* record if you want to use the record object.
*
- * @param String $id
+ * @param String $id
*
- * @return The current instance with the record setted internally.
+ * @return The current instance with the record setted internally or false is nothing have been found.
*/
public function findById($id)
{
- $result = $this->fetchOne("SELECT * from {$this->table} WHERE {$this->id_name} = ?",
+ return $this->fetchOne("SELECT * from {$this->table} WHERE {$this->id_name} = ?",
array($id)
);
-
- if ($result) {
- return $result;
- }
-
- return false;
}
/**
@@ -454,7 +448,7 @@ class BaseModel extends \Towel\BaseApp
$id = $this->getField($field);
}
- $result = $relatedModel->findByID($id);
+ $result = $relatedModel->findById($id);
return $result;
}
|
Improvements in FindById
|
diff --git a/packages/blueprint-gatekeeper/lib/index.js b/packages/blueprint-gatekeeper/lib/index.js
index <HASH>..<HASH> 100644
--- a/packages/blueprint-gatekeeper/lib/index.js
+++ b/packages/blueprint-gatekeeper/lib/index.js
@@ -1,9 +1,11 @@
var blueprint = require ('blueprint')
+ , path = require ('path')
;
// Export the application as a module. This allows other applications to integrate
// our application logic into their application logic.
-module.exports = exports = new blueprint.ApplicationModule ('../app');
+var appPath = path.resolve (__dirname, '../app');
+module.exports = exports = new blueprint.ApplicationModule (appPath);
// Export the authentication package.
exports.auth = require ('./authentication');
\ No newline at end of file
|
Specified the app path incorrectly
|
diff --git a/lib/puppet/functions.rb b/lib/puppet/functions.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/functions.rb
+++ b/lib/puppet/functions.rb
@@ -537,7 +537,7 @@ module Puppet::Functions
required_count = from
# array has just one element, but there may be multiple names that needs to be subtracted from the count
# to make it correct for the last named element
- adjust = param_names.size() -1
+ adjust = max(0, param_names.size() -1)
last_range = [max(0, (from - adjust)), (to - adjust)]
[ args_type.element_type ]
end
|
(PUP-<I>) Fix argument count adjustment for Ruby <I>
There was a problem with PArrayType based signature string
when there are no parameter names - the adjustment resulted
in off by one error in the displayed string.
|
diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/OSQLEngine.java b/core/src/main/java/com/orientechnologies/orient/core/sql/OSQLEngine.java
index <HASH>..<HASH> 100755
--- a/core/src/main/java/com/orientechnologies/orient/core/sql/OSQLEngine.java
+++ b/core/src/main/java/com/orientechnologies/orient/core/sql/OSQLEngine.java
@@ -471,6 +471,8 @@ public class OSQLEngine {
pos = OStringSerializerHelper.getLowerIndexOf(candidate, pos + 1, " ", "\n", "\r", "\t", "(", "[");
if (pos > -1) {
commandName = candidate.substring(0, pos);
+ //remove double spaces
+ commandName = commandName.replaceAll(" ", " ");
found = names.contains(commandName);
} else {
break;
|
Fix parsing problem for two spaces at the beginning of SQL statements
(old parser)
Resolves: #<I>
|
diff --git a/lib/bullet.rb b/lib/bullet.rb
index <HASH>..<HASH> 100644
--- a/lib/bullet.rb
+++ b/lib/bullet.rb
@@ -177,14 +177,17 @@ module Bullet
end
def profile
- Bullet.start_request if Bullet.enable?
+ if Bullet.enable?
+ begin
+ Bullet.start_request
- yield
+ yield
- if Bullet.enable? && Bullet.notification?
- Bullet.perform_out_of_channel_notifications
+ Bullet.perform_out_of_channel_notifications if Bullet.notification?
+ ensure
+ Bullet.end_request
+ end
end
- Bullet.end_request if Bullet.enable?
end
private
|
ensure calling end_request in profile method
|
diff --git a/hacking/core.py b/hacking/core.py
index <HASH>..<HASH> 100644
--- a/hacking/core.py
+++ b/hacking/core.py
@@ -74,6 +74,10 @@ IMPORT_EXCEPTIONS += DEFAULT_IMPORT_EXCEPTIONS
def is_import_exception(mod):
+ """Check module name to see if import has been whitelisted.
+
+ Import based rules should not run on any whitelisted module
+ """
return (mod in IMPORT_EXCEPTIONS or
any(mod.startswith(m + '.') for m in IMPORT_EXCEPTIONS))
|
Add docstring to is_import_exception
Clarify what is_import_exception does. Leave the name as
is_import_exception and no is_import_whitelisted because
import-exceptions is part of the API for hacking (used in the hacking
section of tox.ini).
Change-Id: Ib<I>d<I>ecfcdbcb<I>b<I>ab<I>e<I>a<I>
|
diff --git a/byte-buddy-dep/src/test/java/net/bytebuddy/test/utility/JavaVersionRule.java b/byte-buddy-dep/src/test/java/net/bytebuddy/test/utility/JavaVersionRule.java
index <HASH>..<HASH> 100644
--- a/byte-buddy-dep/src/test/java/net/bytebuddy/test/utility/JavaVersionRule.java
+++ b/byte-buddy-dep/src/test/java/net/bytebuddy/test/utility/JavaVersionRule.java
@@ -27,7 +27,7 @@ public class JavaVersionRule implements MethodRule {
public Statement apply(Statement base, FrameworkMethod method, Object target) {
Enforce enforce = method.getAnnotation(Enforce.class);
if (enforce != null) {
- if (ClassFileVersion.ofJavaVersion(enforce.value()).compareTo(currentVersion) <= 0) {
+ if (ClassFileVersion.ofJavaVersion(enforce.value()).compareTo(currentVersion) > 0) {
return new NoOpStatement(enforce.value());
} else if (!hotSpot) {
for (int javaVersion : enforce.hotSpot()) {
|
Turned arround version comparison for preventing test of a certain level being executed.
|
diff --git a/scs_osio/client_auth.py b/scs_osio/client_auth.py
index <HASH>..<HASH> 100755
--- a/scs_osio/client_auth.py
+++ b/scs_osio/client_auth.py
@@ -22,8 +22,6 @@ from scs_host.sys.host import Host
from scs_osio.cmd.cmd_client_auth import CmdClientAuth
-# TODO: check whether the USER_ID exists on OSIO?
-
# --------------------------------------------------------------------------------------------------------------------
if __name__ == '__main__':
|
Added user check to host_device.
|
diff --git a/views/search.py b/views/search.py
index <HASH>..<HASH> 100644
--- a/views/search.py
+++ b/views/search.py
@@ -533,11 +533,20 @@ def results(qid, p, of, so, rm):
recids = faceted_results_filter(recIDsHitSet,
filter_data,
facets)
+ jrec = request.values.get('jrec', 1, type=int)
+ rg = request.values.get('rg', 10, type=int)
recids = sort_and_rank_records(recids, so=so, rm=rm, p=p)
+ records = len(recids)
+
+ if records > 0 and records < jrec:
+ args = request.values.to_dict()
+ args["jrec"] = 1
+ return redirect(url_for(request.endpoint, qid=qid, **args))
return response_formated_records(
- recids, collection, of,
- create_nearest_terms_box=_create_neareset_term_box, qid=qid)
+ recids[jrec-1:jrec-1+rg], collection, of,
+ create_nearest_terms_box=_create_neareset_term_box, qid=qid,
+ records=records)
return make_results()
|
search: quickfix pagination troubles with facets
* Fixes problem with ignoring pagination options while using facets.
(closes #<I>) (PR #<I>)
|
diff --git a/vint/ast/parsing.py b/vint/ast/parsing.py
index <HASH>..<HASH> 100644
--- a/vint/ast/parsing.py
+++ b/vint/ast/parsing.py
@@ -3,7 +3,6 @@ from vint._bundles import vimlparser
from vint.ast.traversing import traverse
from vint.encodings.decoder import Decoder
from vint.encodings.decoding_strategy import default_decoding_strategy
-from pprint import pprint
class Parser(object):
@@ -38,11 +37,7 @@ class Parser(object):
decoded = decoder.read(file_path)
decoded_and_lf_normalized = decoded.replace('\r\n', '\n')
- try:
- return self.parse(decoded_and_lf_normalized)
- except vimlparser.VimLParserException:
- pprint(decoder.debug_hint)
- raise
+ return self.parse(decoded_and_lf_normalized)
def parse_redir(self, redir_cmd):
|
Remove debugging code (#<I>)
|
diff --git a/commands/command_filter_process.go b/commands/command_filter_process.go
index <HASH>..<HASH> 100644
--- a/commands/command_filter_process.go
+++ b/commands/command_filter_process.go
@@ -139,7 +139,7 @@ func filterCommand(cmd *cobra.Command, args []string) {
// until a read from that channel becomes blocking (in
// other words, we read until there are no more items
// immediately ready to be sent back to Git).
- paths := pathnames(readAvailable(available))
+ paths := pathnames(readAvailable(available, 100))
if len(paths) == 0 {
// If `len(paths) == 0`, `tq.Watch()` has
// closed, indicating that all items have been
@@ -302,8 +302,8 @@ func incomingOrCached(r io.Reader, ptr *lfs.Pointer) (io.Reader, error) {
// 1. Reading from the channel of available items blocks, or ...
// 2. There is one item available, or ...
// 3. The 'tq.TransferQueue' is completed.
-func readAvailable(ch <-chan *tq.Transfer) []*tq.Transfer {
- ts := make([]*tq.Transfer, 0, 100)
+func readAvailable(ch <-chan *tq.Transfer, cap int) []*tq.Transfer {
+ ts := make([]*tq.Transfer, 0, cap)
for {
select {
|
commands: make 'readAvailable' take an initial capacity
|
diff --git a/src/Auth/ResetPassword/ResetPasswordRepository.php b/src/Auth/ResetPassword/ResetPasswordRepository.php
index <HASH>..<HASH> 100644
--- a/src/Auth/ResetPassword/ResetPasswordRepository.php
+++ b/src/Auth/ResetPassword/ResetPasswordRepository.php
@@ -4,7 +4,6 @@ namespace Nodes\Api\Auth\ResetPassword;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model as IlluminateModel;
use Illuminate\Support\Facades\Mail;
-use Illuminate\Support\Facades\Hash;
use Nodes\Api\Auth\Exceptions\ResetPasswordNoUserException;
use Nodes\Database\Eloquent\Repository as NodesRepository;
use Nodes\Api\Auth\Exceptions\MissingUserModelException;
@@ -181,7 +180,7 @@ class ResetPasswordRepository extends NodesRepository
// Update user with new password
return (bool) $user->update([
- 'password' => Hash::make($password)
+ 'password' => $password
]);
}
}
|
Don't hash in ResetPasswordRepository. This should be done in the user model with setPasswordAttribute()
|
diff --git a/git/git.go b/git/git.go
index <HASH>..<HASH> 100644
--- a/git/git.go
+++ b/git/git.go
@@ -17,6 +17,7 @@ import (
"regexp"
"strconv"
"strings"
+ "syscall"
"time"
lfserrors "github.com/git-lfs/git-lfs/errors"
@@ -685,9 +686,13 @@ func GitAndRootDirs() (string, string, error) {
// If we got a fatal error, it's possible we're on a newer
// (2.24+) Git and we're not in a worktree, so fall back to just
// looking up the repo directory.
- if e, ok := err.(*exec.ExitError); ok && e.ProcessState.ExitCode() == 128 {
- absGitDir, err := GitDir()
- return absGitDir, "", err
+ if e, ok := err.(*exec.ExitError); ok {
+ var ws syscall.WaitStatus
+ ws, ok = e.ProcessState.Sys().(syscall.WaitStatus)
+ if ok && ws.ExitStatus() == 128 {
+ absGitDir, err := GitDir()
+ return absGitDir, "", err
+ }
}
return "", "", fmt.Errorf("failed to call git rev-parse --git-dir --show-toplevel: %q", buf.String())
}
|
git/git.go: use Go <I> compatible ExitStatus
We can retain support for Go <I> by replacing ProcessState.ExitCode()
with ProcessState.Sys(), which we then try to convert to
syscall.WaitStatus before using WaitStatus.ExitStatus().
|
diff --git a/src/FieldHandlers/ListFieldHandler.php b/src/FieldHandlers/ListFieldHandler.php
index <HASH>..<HASH> 100644
--- a/src/FieldHandlers/ListFieldHandler.php
+++ b/src/FieldHandlers/ListFieldHandler.php
@@ -73,9 +73,16 @@ class ListFieldHandler extends BaseFieldHandler
$result = $data;
$listName = $this->_getListName($options['fieldDefinitions']['type']);
$fieldOptions = $this->_getListFieldOptions($listName);
+ $fieldOptions = $this->_filterOptions($fieldOptions);
+
+ /*
+ nested list options
+ */
+ $collection = new Collection($fieldOptions);
+ $fieldOptions = $collection->listNested()->printer('name', 'id', null)->toArray();
- if (!empty($fieldOptions[$data]['label'])) {
- $result = h($fieldOptions[$data]['label']);
+ if (isset($fieldOptions[$data])) {
+ $result = h($fieldOptions[$data]);
}
return $result;
|
modify List Handler input value logic to support new nested functionality (task #<I>)
|
diff --git a/src/Parser/Comment.php b/src/Parser/Comment.php
index <HASH>..<HASH> 100644
--- a/src/Parser/Comment.php
+++ b/src/Parser/Comment.php
@@ -59,7 +59,8 @@ class Comment extends PartParser
if($this->openedParenthesis >= 1) {
return new InvalidEmail(new UnclosedComment(), $this->lexer->token['value']);
- } else if ($this->openedParenthesis < 0) {
+ }
+ if ($this->openedParenthesis < 0) {
return new InvalidEmail(new UnOpenedComment(), $this->lexer->token['value']);
}
|
No superfluous elseif (#<I>)
Replaces superfluous elseif with if.
|
diff --git a/lib/flag_shih_tzu.rb b/lib/flag_shih_tzu.rb
index <HASH>..<HASH> 100644
--- a/lib/flag_shih_tzu.rb
+++ b/lib/flag_shih_tzu.rb
@@ -100,6 +100,22 @@ module FlagShihTzu
def self.unset_#{flag_name}_sql
sql_set_for_flag(:#{flag_name}, '#{colmn}', false)
end
+
+ def self.#{colmn.singularize}_values_for(*flag_names)
+ values = []
+ flag_names.each do |flag_name|
+ if respond_to?(flag_name)
+ values_for_flag = send(:sql_in_for_flag, flag_name, '#{colmn}')
+ values = if values.present?
+ values & values_for_flag
+ else
+ values_for_flag
+ end
+ end
+ end
+
+ values.sort
+ end
EVAL
if colmn != DEFAULT_COLUMN_NAME
|
Add dynamic ".*_values_for" helpers
|
diff --git a/test_settings.py b/test_settings.py
index <HASH>..<HASH> 100644
--- a/test_settings.py
+++ b/test_settings.py
@@ -17,3 +17,27 @@ except ImportError:
pass
SITE_ID = 1
+
+LOGGING = {
+ 'version': 1,
+ 'disable_existing_loggers': True,
+ 'formatters': {
+ 'simple': {
+ 'format': '- %(levelname)s %(message)s'
+ },
+ },
+ 'handlers': {
+ 'console':{
+ 'level': 'DEBUG',
+ 'class': 'logging.StreamHandler',
+ 'formatter': 'simple'
+ },
+ },
+ 'loggers': {
+ '': {
+ 'handlers': ['console'],
+ 'propagate': True,
+ 'level': 'INFO',
+ },
+ }
+}
|
Infrastructure for convenient logging during tests.
|
diff --git a/src/components/source.js b/src/components/source.js
index <HASH>..<HASH> 100644
--- a/src/components/source.js
+++ b/src/components/source.js
@@ -59,7 +59,7 @@ module.exports = class ComponentSource extends Source {
const content = yield variant.getContent(true);
const rendered = yield engine.render(variant.viewPath, content, context);
if (layout && variant.preview) {
- let layout = source.find(variant.preview);
+ let layout = source.find(`@${variant.preview.replace('@','')}`);
if (!layout) {
logger.error(`Preview layout ${variant.preview} for component ${variant._parent.handle} not found.`);
return rendered;
|
fix(components): make preview find call @-prefix agnostic
|
diff --git a/ezp/Persistence/Content/CreateStruct.php b/ezp/Persistence/Content/CreateStruct.php
index <HASH>..<HASH> 100644
--- a/ezp/Persistence/Content/CreateStruct.php
+++ b/ezp/Persistence/Content/CreateStruct.php
@@ -16,8 +16,7 @@ use ezp\Persistence\ValueObject;
class CreateStruct extends ValueObject
{
/**
- * @todo Language?
- * @var string
+ * @var string[] Eg. array( 'eng-GB' => "New Article" )
*/
public $name;
diff --git a/ezp/Persistence/Content/UpdateStruct.php b/ezp/Persistence/Content/UpdateStruct.php
index <HASH>..<HASH> 100644
--- a/ezp/Persistence/Content/UpdateStruct.php
+++ b/ezp/Persistence/Content/UpdateStruct.php
@@ -26,7 +26,13 @@ class UpdateStruct extends ValueObject
public $versionNo;
/**
- * @var int
+ * @var string[] Eg. array( 'eng-GB' => "New Article" )
+ */
+ public $name;
+
+ /**
+ * @var int Creator of the version
+ * @todo Rename to creatorId to be consistent
*/
public $userId;
|
Add: $name on Content\UpdateStruct and document it as string[] to support languages
|
diff --git a/lib/easy_captcha/routes.rb b/lib/easy_captcha/routes.rb
index <HASH>..<HASH> 100644
--- a/lib/easy_captcha/routes.rb
+++ b/lib/easy_captcha/routes.rb
@@ -3,7 +3,7 @@ module ActionDispatch #:nodoc:
class Mapper #:nodoc:
# call to add default captcha root
def captcha_route
- match "captcha" => EasyCaptcha::Controller, :via => :get
+ match 'captcha' => EasyCaptcha::Controller, :action => :captcha, :via => :get
end
end
end
|
fixes controller namespacing in routes; closes #3
|
diff --git a/toml.py b/toml.py
index <HASH>..<HASH> 100644
--- a/toml.py
+++ b/toml.py
@@ -58,6 +58,10 @@ def parse_value(v):
elif v == 'false':
return False
elif v[0] == '"':
+ escapes = ['0', 'n', 'r', 't', '"', '\\']
+ escapedchars = ['\0', '\n', '\r', '\t', '\"', '\\']
+ for i in xrange(len(escapes)):
+ v = v.replace("\\"+escapes[i], escapedchars[i])
return v[1:-1]
elif v[0] == '[':
return parse_array(v)
@@ -67,7 +71,11 @@ def parse_value(v):
else:
raise Exception("Wait, what?")
else:
- return int(v)
+ try:
+ int(v)
+ return int(v)
+ except ValueError:
+ return float(v)
def parse_array(a):
|
Fix issue with escaped characters and floats
I think I discovered a bug in PyYAML
|
diff --git a/spaceship/lib/spaceship/test_flight/client.rb b/spaceship/lib/spaceship/test_flight/client.rb
index <HASH>..<HASH> 100644
--- a/spaceship/lib/spaceship/test_flight/client.rb
+++ b/spaceship/lib/spaceship/test_flight/client.rb
@@ -112,6 +112,10 @@ module Spaceship
req.body = body.to_json
req.headers['Content-Type'] = 'application/json'
end
+
+ # This is invalid now.
+ @cached_groups.delete(app_id) if @cached_groups
+
handle_response(response)
end
|
Invalidate group list when a group is created (#<I>)
* Invalidate group list when a group is created
* Fixing tests
|
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index <HASH>..<HASH> 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -1,22 +1,12 @@
<?php
-$files = array(
- __DIR__.'/../vendor/autoload.php', //submodule autoloading
- __DIR__.'/../../../autoload.php' //composer autoloading
-);
-
-foreach ($files as $file){
- if (file_exists($file)) {
- require_once $file;
- $autoloaded = true;
- break;
- }
-}
-
-if(!$autoloaded){
+$file = __DIR__.'/../vendor/autoload.php';
+if (!file_exists($file)) {
throw new RuntimeException('Install dependencies to run test suite.');
}
+require_once $file;
+
use Doctrine\Common\ClassLoader;
use Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver;
|
Remembered to put tests/bootstrap.php back
|
diff --git a/src/Readability.php b/src/Readability.php
index <HASH>..<HASH> 100644
--- a/src/Readability.php
+++ b/src/Readability.php
@@ -1564,7 +1564,7 @@ class Readability
*/
public function getContent()
{
- return $this->content->C14N();
+ return (null !== $this->content) ? $this->content->C14N() : null;
}
/**
|
Fix error C<I>N
I have the error:
"Call to a member function C<I>N() on null"
You could reproduce like this:
- try to parse a url like <URL> with the same object readability
Previously, getContent would return "null" but now it call ->C<I>N() on a NULL object.
|
diff --git a/client/wordpress-com.js b/client/wordpress-com.js
index <HASH>..<HASH> 100644
--- a/client/wordpress-com.js
+++ b/client/wordpress-com.js
@@ -348,7 +348,8 @@ if ( config.isEnabled( 'manage/custom-post-types' ) ) {
name: 'posts-custom',
paths: [ '/types' ],
module: 'my-sites/types',
- secondary: true
+ secondary: true,
+ group: 'sites'
} );
}
|
CPT: Set types group to sites
So “My Sites” master bar link appears as active
|
diff --git a/config/webpack.test.js b/config/webpack.test.js
index <HASH>..<HASH> 100644
--- a/config/webpack.test.js
+++ b/config/webpack.test.js
@@ -55,7 +55,10 @@ module.exports = function(env) {
exclude: [
/\.(e2e|spec)\.ts$/,
/node_modules/
- ]
+ ],
+ query: {
+ esModules: true
+ }
}
]
},
|
bug(tests): fix build?
|
diff --git a/src/Query/LaravelQuery.php b/src/Query/LaravelQuery.php
index <HASH>..<HASH> 100644
--- a/src/Query/LaravelQuery.php
+++ b/src/Query/LaravelQuery.php
@@ -200,6 +200,7 @@ class LaravelQuery extends LaravelBaseQuery implements IQueryProvider
$skip = null,
$skipToken = null
) {
+ /** @var Model $source */
$source = $this->unpackSourceEntity($sourceEntityInstance);
return $this->getReader()->getRelatedResourceSet(
$queryType,
@@ -235,6 +236,7 @@ class LaravelQuery extends LaravelBaseQuery implements IQueryProvider
ResourceProperty $targetProperty,
KeyDescriptor $keyDescriptor
) {
+ /** @var Model $source */
$source = $this->unpackSourceEntity($sourceEntityInstance);
return $this->getReader()->getResourceFromRelatedResourceSet(
$sourceResourceSet,
@@ -264,6 +266,7 @@ class LaravelQuery extends LaravelBaseQuery implements IQueryProvider
ResourceSet $targetResourceSet,
ResourceProperty $targetProperty
) {
+ /** @var Model $source */
$source = $this->unpackSourceEntity($sourceEntityInstance);
$result = $this->getReader()->getRelatedResourceReference(
|
Annotate source unpacks in LaravelQuery
|
diff --git a/login/signup.php b/login/signup.php
index <HASH>..<HASH> 100644
--- a/login/signup.php
+++ b/login/signup.php
@@ -34,11 +34,9 @@
}
}
- if ($err) {
- foreach ((array)$err as $key => $value) {
- $focus = "form.$key";
- }
- }
+ if ($err) {
+ $focus = 'form.' . array_shift(array_flip(get_object_vars($err)));
+ }
if (!$user->country and $CFG->country) {
$user->country = $CFG->country;
|
Much cooler way to set the form focus after an error. Sent in by Greg Barnett.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.