diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/src/test/entry.test.js b/src/test/entry.test.js
index <HASH>..<HASH> 100644
--- a/src/test/entry.test.js
+++ b/src/test/entry.test.js
@@ -307,3 +307,26 @@ test('entry by duration with date', t => {
t.end()
})
+
+test('entry duration whitespace', t => {
+ let e
+ e = new Entry(userId, '1-2pm ate 4 hotdogs')
+ t.equal(e.createdFrom, 'calendar', 'used 1-2pm instead of 4 h')
+
+ e = new Entry(userId, '1-2pm ate 3 mini dougnuts')
+ t.equal(e.createdFrom, 'calendar', 'used 1-2pm instead of 3 m')
+
+ try {
+ e = new Entry(userId, '2:30-3:30 meeting')
+ } catch(err) {
+ t.equal(err.name, 'NoMeridiemError', 'threw error instead of using 30 m')
+ }
+
+ e = new Entry(userId, '9am-10 Researching SMS online S3 hosting options')
+ t.equal(e.createdFrom, 'calendar', 'used 9am-10 instead of 3 h')
+
+ e = new Entry(userId, '1:30-2:45pm 2 month planning meeting')
+ t.equal(e.createdFrom, 'calendar', 'used 1:30-2:45pm instead of 2 m')
+
+ t.end()
+})
|
Add tests with full entry parsing
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -80,7 +80,7 @@ setup(
"Programming Language :: Python :: 3.8",
],
keywords="api graphql protocol rest relay graphene",
- packages=find_packages(exclude=["tests", "tests.*", "examples"]),
+ packages=find_packages(exclude=["tests", "tests.*", "examples*"]),
install_requires=[
"graphql-core>=3.1.0b1,<4",
"graphql-relay>=3.0,<4",
|
Update excluded packages list to properly exclude examples pack… (#<I>)
* examples package will not be installed with graphene
|
diff --git a/rxandroidble/src/main/java/com/polidea/rxandroidble/internal/RxBleLog.java b/rxandroidble/src/main/java/com/polidea/rxandroidble/internal/RxBleLog.java
index <HASH>..<HASH> 100644
--- a/rxandroidble/src/main/java/com/polidea/rxandroidble/internal/RxBleLog.java
+++ b/rxandroidble/src/main/java/com/polidea/rxandroidble/internal/RxBleLog.java
@@ -3,6 +3,8 @@ package com.polidea.rxandroidble.internal;
import android.support.annotation.IntDef;
import android.util.Log;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -12,6 +14,7 @@ import java.util.regex.Pattern;
public class RxBleLog {
@IntDef({VERBOSE, DEBUG, INFO, WARN, ERROR, NONE})
+ @Retention(RetentionPolicy.SOURCE)
public @interface LogLevel {
}
|
Fixed retention policy of RxBleLog log levels.
|
diff --git a/lib/pool.js b/lib/pool.js
index <HASH>..<HASH> 100644
--- a/lib/pool.js
+++ b/lib/pool.js
@@ -22,32 +22,16 @@ class Pool {
}, () => new Client(url, options))
}
- stream (opts, factory, cb) {
- if (cb === undefined) {
- return new Promise((resolve, reject) => {
- this.stream(opts, factory, (err, data) => {
- return err ? reject(err) : resolve(data)
- })
- })
- }
-
- getNext(this).stream(opts, factory, cb)
+ stream (opts, factory, callback) {
+ return getNext(this).stream(opts, factory, callback)
}
pipeline (opts, handler) {
return getNext(this).pipeline(opts, handler)
}
- request (opts, cb) {
- if (cb === undefined) {
- return new Promise((resolve, reject) => {
- this.request(opts, (err, data) => {
- return err ? reject(err) : resolve(data)
- })
- })
- }
-
- getNext(this).request(opts, cb)
+ request (opts, callback) {
+ return getNext(this).request(opts, callback)
}
upgrade (opts, callback) {
|
refactor: pool doesn't need to create promise
|
diff --git a/api/server/router/volume/volume.go b/api/server/router/volume/volume.go
index <HASH>..<HASH> 100644
--- a/api/server/router/volume/volume.go
+++ b/api/server/router/volume/volume.go
@@ -5,13 +5,13 @@ import (
"github.com/docker/docker/api/server/router/local"
)
-// volumesRouter is a router to talk with the volumes controller
+// volumeRouter is a router to talk with the volumes controller
type volumeRouter struct {
backend Backend
routes []router.Route
}
-// NewRouter initializes a new volumes router
+// NewRouter initializes a new volumeRouter
func NewRouter(b Backend) router.Router {
r := &volumeRouter{
backend: b,
|
Modify improper comments in api/server/router/volume/volume.go
|
diff --git a/src/FamilySearch.js b/src/FamilySearch.js
index <HASH>..<HASH> 100644
--- a/src/FamilySearch.js
+++ b/src/FamilySearch.js
@@ -24,7 +24,7 @@
* @param {String} options.tokenCookie Name of the cookie that the access token
* will be saved in.
*/
- var FamilySearch = function(options){
+ var FamilySearch = exports.FamilySearch = function(options){
this.appKey = options.appKey;
this.environment = options.environment || 'sandbox';
this.redirectUri = options.redirectUri;
@@ -98,6 +98,10 @@
options = {};
}
+ if(!callback){
+ callback = function(){};
+ }
+
if(options.method){
method = options.method;
}
@@ -133,7 +137,7 @@
if(typeof body !== 'string'){
// JSON.stringify() if the content-type is JSON
- if(headers['Content-Type'] && headers['Content-Type'].indexOf('json')){
+ if(headers['Content-Type'] && headers['Content-Type'].indexOf('json') !== -1){
body = JSON.stringify(body);
}
|
fix body processing and missing callback error
|
diff --git a/Classes/Domain/Repository/RedirectionRepository.php b/Classes/Domain/Repository/RedirectionRepository.php
index <HASH>..<HASH> 100644
--- a/Classes/Domain/Repository/RedirectionRepository.php
+++ b/Classes/Domain/Repository/RedirectionRepository.php
@@ -87,6 +87,21 @@ class RedirectionRepository extends Repository
}
/**
+ * @param string $targetUriPath
+ * @param string $host Host or host pattern
+ * @return QueryInterface
+ */
+ public function findByTargetUriPathAndHost($targetUriPath, $host = null)
+ {
+ /** @var Query $query */
+ $query = $this->entityManager->createQuery('SELECT r FROM Neos\RedirectHandler\DatabaseStorage\Domain\Model\Redirection r WHERE r.targetUriPathHash = :targetUriPathHash AND (r.host = :host OR r.host IS NULL)');
+ $query->setParameter('targetUriPathHash', md5(trim($targetUriPath, '/')));
+ $query->setParameter('host', $host);
+
+ return $this->iterate($query->iterate());
+ }
+
+ /**
* Finds all objects and return an IterableResult
*
* @param string $host Full qualified hostname or host pattern
|
TASK: Use DQL and generator to find by target uri and host
|
diff --git a/config/admin/jsonadm/resource.php b/config/admin/jsonadm/resource.php
index <HASH>..<HASH> 100644
--- a/config/admin/jsonadm/resource.php
+++ b/config/admin/jsonadm/resource.php
@@ -250,7 +250,7 @@ return [
* @param array List of user group names
* @since 2017.10
*/
- 'groups' => ['admin', 'super'],
+ 'groups' => ['super'],
],
'language' => [
/** admin/jsonadm/resource/locale/language/groups
@@ -259,7 +259,7 @@ return [
* @param array List of user group names
* @since 2017.10
*/
- 'groups' => ['admin', 'super'],
+ 'groups' => ['super'],
],
'currency' => [
/** admin/jsonadm/resource/locale/currency/groups
@@ -268,7 +268,7 @@ return [
* @param array List of user group names
* @since 2017.10
*/
- 'groups' => ['admin', 'super'],
+ 'groups' => ['super'],
],
],
'media' => [
|
Restrict locale/* resources to super admins only
|
diff --git a/discord/state.py b/discord/state.py
index <HASH>..<HASH> 100644
--- a/discord/state.py
+++ b/discord/state.py
@@ -215,7 +215,7 @@ class ConnectionState:
self.clear()
- def clear(self) -> None:
+ def clear(self, *, views: bool = True) -> None:
self.user: Optional[ClientUser] = None
# Originally, this code used WeakValueDictionary to maintain references to the
# global user mapping.
@@ -233,7 +233,9 @@ class ConnectionState:
self._emojis: Dict[int, Emoji] = {}
self._stickers: Dict[int, GuildSticker] = {}
self._guilds: Dict[int, Guild] = {}
- self._view_store: ViewStore = ViewStore(self)
+ if views:
+ self._view_store: ViewStore = ViewStore(self)
+
self._voice_clients: Dict[int, VoiceProtocol] = {}
# LRU of max size 128
@@ -524,7 +526,7 @@ class ConnectionState:
self._ready_task.cancel()
self._ready_state = asyncio.Queue()
- self.clear()
+ self.clear(views=False)
self.user = ClientUser(state=self, data=data['user'])
self.store_user(data['user'])
|
Don't clear views in READY
|
diff --git a/core/Object.php b/core/Object.php
index <HASH>..<HASH> 100755
--- a/core/Object.php
+++ b/core/Object.php
@@ -418,9 +418,12 @@ abstract class Object {
// merge with existing static vars
$extensions = self::uninherited_static($class, 'extensions');
+
// We use unshift rather than push so that module extensions are added before built-in ones.
// in particular, this ensures that the Versioned rewriting is done last.
- array_unshift($extensions, $extension);
+ if($extensions) array_unshift($extensions, $extension);
+ else $extensions = array($extension);
+
self::set_static($class, 'extensions', $extensions);
// load statics now for DataObject classes
|
BUGFIX: Ameneded r<I> so that the application order of extensions is the same as it was previously.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@<I> <I>b<I>ca-7a2a-<I>-9d3b-<I>d<I>a<I>a9
|
diff --git a/src/Subjects/AbstractSubject.php b/src/Subjects/AbstractSubject.php
index <HASH>..<HASH> 100644
--- a/src/Subjects/AbstractSubject.php
+++ b/src/Subjects/AbstractSubject.php
@@ -870,7 +870,7 @@ abstract class AbstractSubject implements SubjectInterface, FilesystemSubjectInt
// log a message that the file has successfully been imported,
// use log level warning ONLY if rows have been skipped
$systemLogger->log(
- $skippedRows = $this->getSkippedRows() > 0 ? LogLevel::WARNING : LogLevel::INFO,
+ $skippedRows = $this->getSkippedRows() > 0 ? LogLevel::WARNING : LogLevel::NOTICE,
sprintf(
'Successfully processed file "%s" with "%d" lines (skipping "%d") in "%f" s',
basename($filename),
|
Switch log level for message when a file has successfully been processed from info to notice to make it visible on CLI
|
diff --git a/src/cmdline/settings.py b/src/cmdline/settings.py
index <HASH>..<HASH> 100644
--- a/src/cmdline/settings.py
+++ b/src/cmdline/settings.py
@@ -170,11 +170,12 @@ class SettingsParser(BaseCommand):
parser.add_argument(arg, **_info)
- if subcommands:
+ command_info = args.get('_COMMANDS', {})
+
+ if subcommands or command_info:
self.subparsers = parser.add_subparsers(help='sub-commands')
# go through all the args found for subcommands and create a subparser for them
- command_info = args.get('_COMMANDS', {})
for subcommand, args in subcommands.items():
kwargs = command_info.get(subcommand, {})
subcommand_parser = self.subparsers.add_parser(subcommand, **kwargs)
@@ -182,3 +183,10 @@ class SettingsParser(BaseCommand):
self.parse(args=args, parser=subcommand_parser)
subcommand_parser.set_defaults(subcommand=subcommand)
+
+ # check for any commands listed in command_info without additional settings
+ for subcommand in set(command_info.keys()) - set(subcommands.keys()):
+ kwargs = command_info[subcommand]
+ subcommand_parser = self.subparsers.add_parser(subcommand, **kwargs)
+
+ subcommand_parser.set_defaults(subcommand=subcommand)
|
Add subcommands that do not have any additional settings
|
diff --git a/lib/Github/Api/Repo.php b/lib/Github/Api/Repo.php
index <HASH>..<HASH> 100644
--- a/lib/Github/Api/Repo.php
+++ b/lib/Github/Api/Repo.php
@@ -143,6 +143,20 @@ class Repo extends AbstractApi
{
return $this->delete('repos/'.rawurlencode($username).'/'.rawurlencode($repository));
}
+
+ /**
+ * Get the readme content for a repository by its username and repository name
+ * @link http://developer.github.com/v3/repos/contents/#get-the-readme
+ *
+ * @param string $username the user who owns the repository
+ * @param string $repository the name of the repository
+ *
+ * @return array the readme content
+ */
+ public function readme($username, $repository)
+ {
+ return $this->get('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/readme');
+ }
/**
* Manage the collaborators of a repository
|
Add API request to get the readme content
Adding a `readme` method to the repo api to get the readme for a repository. This is described by <URL>
|
diff --git a/src/components/column/Column.js b/src/components/column/Column.js
index <HASH>..<HASH> 100644
--- a/src/components/column/Column.js
+++ b/src/components/column/Column.js
@@ -41,7 +41,8 @@ export class Column extends Component {
excludeGlobalFilter: false,
rowReorder: false,
rowReorderIcon: 'pi pi-bars',
- rowEditor: false
+ rowEditor: false,
+ exportable: true
}
static propTypes = {
@@ -82,6 +83,7 @@ export class Column extends Component {
excludeGlobalFilter: PropTypes.bool,
rowReorder: PropTypes.bool,
rowReorderIcon: PropTypes.string,
- rowEditor: PropTypes.bool
+ rowEditor: PropTypes.bool,
+ exportable: PropTypes.bool
}
}
\ No newline at end of file
|
Fixed #<I> - Add exportable property to Column
|
diff --git a/api/src/main/java/org/ehcache/resilience/ResilienceStrategy.java b/api/src/main/java/org/ehcache/resilience/ResilienceStrategy.java
index <HASH>..<HASH> 100644
--- a/api/src/main/java/org/ehcache/resilience/ResilienceStrategy.java
+++ b/api/src/main/java/org/ehcache/resilience/ResilienceStrategy.java
@@ -24,6 +24,8 @@ import org.ehcache.exceptions.BulkCacheWriterException;
import org.ehcache.exceptions.CacheAccessException;
import org.ehcache.exceptions.CacheLoaderException;
import org.ehcache.exceptions.CacheWriterException;
+import org.ehcache.spi.loader.CacheLoader;
+import org.ehcache.spi.writer.CacheWriter;
/**
* A strategy for providing cache resilience in the face of failure.
@@ -33,6 +35,12 @@ import org.ehcache.exceptions.CacheWriterException;
* these methods are expected to take suitable recovery steps. They can then
* choose between allowing the operation to terminate successfully, or throw an
* exception which will be propagated to the thread calling in to the cache.
+ * <p>
+ * Resilience in this context refers only to resilience against cache failures
+ * and not to resilience against failures of any underlying {@link CacheWriter}
+ * or {@link CacheLoader}. To this end writer or loader failures will only be
+ * reported to the strategy in the context of a coincident cache failure.
+ * Isolated writer and loader exceptions will be thrown directly.
*
* @author Chris Dennis
*/
|
#<I> : add javadoc clarifying writer/loader and resilience strategy interactions
|
diff --git a/nodeserver/src/client/js/corewrapper.js b/nodeserver/src/client/js/corewrapper.js
index <HASH>..<HASH> 100644
--- a/nodeserver/src/client/js/corewrapper.js
+++ b/nodeserver/src/client/js/corewrapper.js
@@ -881,6 +881,7 @@ define(['logManager',
};
ClientNode = function(node,core){
var ownpath = core.getStringPath(node);
+ var ownpathpostfix = ownpath === "" ? "" : "/";
this.getParentId = function(){
var parent = core.getParent(node);
if(parent){
@@ -894,9 +895,8 @@ define(['logManager',
};
this.getChildrenIds = function(){
var children = core.getChildrenRelids(node);
- ownpath += ownpath === "" ? "" : "/";
for(var i=0;i<children.length;i++){
- children[i]=ownpath+children[i];
+ children[i]=ownpath+ownpathpostfix+children[i];
}
return children;
};
@@ -931,7 +931,7 @@ define(['logManager',
};
var getNodePath = function(node){
- var path = core.getStringPath(node);
+ var path = /*core.getStringPath(node)*/ownpath;
if(path === ""){
path = "root";
}
|
getChildrenIds was corrected
Former-commit-id: db7f<I>cbfe<I>c<I>bb<I>c<I>dea<I>f<I>
|
diff --git a/lib/util/wrap.js b/lib/util/wrap.js
index <HASH>..<HASH> 100644
--- a/lib/util/wrap.js
+++ b/lib/util/wrap.js
@@ -23,16 +23,16 @@ exports.wrapExport = function (wrapFunction, required, optional) {
var collectOptions = true;
if (length === 1 && (first instanceof Object)) {
assume = true;
- var requiredArg = required[0];
- if (requiredArg && requiredArg instanceof Object) {
- for (var i = 0; i < requiredArg.length; i++) {
- if (first[requiredArg[i]]) {
+ var firstArg = required[0] || optional;
+ if (firstArg && firstArg instanceof Object) {
+ for (var i = 0; i < firstArg.length; i++) {
+ if (first[firstArg[i]]) {
options = first;
collectOptions = false;
break;
}
}
- } else if (requiredArg && first[requiredArg]) {
+ } else if (firstArg && first[firstArg]) {
options = first;
collectOptions = false;
}
|
Fix if there is only one argument and the function has no required arguments
Will now search through all the optional arguments.
|
diff --git a/src/resolvers/helpers/filter.js b/src/resolvers/helpers/filter.js
index <HASH>..<HASH> 100644
--- a/src/resolvers/helpers/filter.js
+++ b/src/resolvers/helpers/filter.js
@@ -77,6 +77,10 @@ export const filterHelperArgs = (
);
}
+ if (inputComposer.getFieldNames().length === 0) {
+ return {};
+ }
+
return {
filter: {
name: 'filter',
|
fix filterHelper, it does not return `filter` arg, if its fields are empty
|
diff --git a/src/UrlRoute.php b/src/UrlRoute.php
index <HASH>..<HASH> 100644
--- a/src/UrlRoute.php
+++ b/src/UrlRoute.php
@@ -29,7 +29,7 @@ class UrlRoute extends Route {
return $this->callback;
}
- public function dispatch(array $args) {
+ public function dispatch(array &$args) {
$callback = $args['callback'];
$callback_args = reflectArgs($callback, $args['args']);
@@ -61,10 +61,12 @@ class UrlRoute extends Route {
/**
* Convert a path pattern into its regex.
- * @param string $pattern
+ *
+ * @param string $pattern The route pattern to convert into a regular expression.
+ * @return string Returns the regex pattern for the route.
*/
protected static function patternRegex($pattern) {
- $result = preg_replace_callback('`{([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)}`i', function($match) {
+ $result = preg_replace_callback('`{([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)}`i', function ($match) {
$param = $match[1];
$param_pattern = '[^/]+';
$result = "(?<$param>$param_pattern)";
|
UrlRoute fix and doc comments.
|
diff --git a/openquake/commands/restore.py b/openquake/commands/restore.py
index <HASH>..<HASH> 100644
--- a/openquake/commands/restore.py
+++ b/openquake/commands/restore.py
@@ -22,6 +22,7 @@ import time
import os.path
import zipfile
import sqlite3
+import requests
from openquake.baselib import sap
from openquake.baselib.general import safeprint
from openquake.server.dbapi import Db
@@ -32,13 +33,19 @@ def restore(archive, oqdata):
"""
Build a new oqdata directory from the data contained in the zip archive
"""
+ if os.path.exists(oqdata):
+ sys.exit('%s exists already' % oqdata)
+ if '://' in archive:
+ # get the zip archive from an URL
+ resp = requests.get(archive)
+ _, archive = archive.rsplit('/', 1)
+ with open(archive, 'wb') as f:
+ f.write(resp.content)
if not os.path.exists(archive):
sys.exit('%s does not exist' % archive)
t0 = time.time()
oqdata = os.path.abspath(oqdata)
assert archive.endswith('.zip'), archive
- if os.path.exists(oqdata):
- sys.exit('%s exists already' % oqdata)
os.mkdir(oqdata)
zipfile.ZipFile(archive).extractall(oqdata)
dbpath = os.path.join(oqdata, 'db.sqlite3')
|
Extended oq restore to download from URLs [skip CI]
Former-commit-id: dcc<I>c<I>a0ff3c<I>d7d<I>e<I>b<I>f<I>f
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -21,6 +21,7 @@ setup(
version=version,
description='Python API for accessing the REST API of the Xero accounting tool.',
long_description=long_description,
+ long_description_content_type='text/markdown',
author='Russell Keith-Magee',
author_email='russell@keith-magee.com',
url='http://github.com/freakboy3742/pyxero',
|
Corrected markup content type for long description.
|
diff --git a/src/components/inputs/select-input/select-input.spec.js b/src/components/inputs/select-input/select-input.spec.js
index <HASH>..<HASH> 100644
--- a/src/components/inputs/select-input/select-input.spec.js
+++ b/src/components/inputs/select-input/select-input.spec.js
@@ -116,6 +116,25 @@ describe('in single mode', () => {
});
});
describe('interacting', () => {
+ describe('when isAutofocussed is `true`', () => {
+ it('should open the list and all options should be visible', () => {
+ const { getByLabelText, getByText } = renderInput({
+ isAutofocussed: true,
+ });
+
+ const input = getByLabelText('Fruit');
+
+ fireEvent.blur(input);
+
+ fireEvent.keyDown(input, {
+ key: 'ArrowDown',
+ });
+
+ expect(getByText('Mango')).toBeInTheDocument();
+ expect(getByText('Lichi')).toBeInTheDocument();
+ expect(getByText('Raspberry')).toBeInTheDocument();
+ });
+ });
it('should open the list and all options should be visible', () => {
const { getByLabelText, getByText } = renderInput();
const input = getByLabelText('Fruit');
|
chore(select-input): add test for when autoFocussed is true (#<I>)
* chore(select-input): add test for when autoFocussed is true
|
diff --git a/test/specs/utils/Sorter.js b/test/specs/utils/Sorter.js
index <HASH>..<HASH> 100644
--- a/test/specs/utils/Sorter.js
+++ b/test/specs/utils/Sorter.js
@@ -1,7 +1,8 @@
-var Sorter = require('undefined');
+// import Sorter from '../../../src/utils/Sorter.js'
-describe('Sorter', () => {
- var fixtures;
+// TODO: Migrate this file to Jest
+
+describe.skip('Sorter', () => {
var fixture;
var obj;
var parent;
|
Skip sorter test (awaiting migrate to jest)
|
diff --git a/Framework/FileOrganiser.php b/Framework/FileOrganiser.php
index <HASH>..<HASH> 100644
--- a/Framework/FileOrganiser.php
+++ b/Framework/FileOrganiser.php
@@ -4,7 +4,19 @@
* of the FileOrganiser to copy the required files into the webroot when
* required. The files may need to be minified and compiled before they are
* copied.
- * TODO: What about overriding Gt files with App files? (test)
+ *
+ * TODO: Implement these steps.
+ * Steps made in this file:
+ * 1) Loop over all files within Style and Script directories of APPROOT and
+ * GTROOT, making a list of all files to be copied.
+ * 2) For each .js and .css file, check the filemtime against the public
+ * files of the same name, or the compiled Script.js/Style.css file. Remove file
+ * from copy list if not changed.
+ * 3) For each .scss file, check the filemtime against the public files of
+ * the same name, with .css extension, or the compiled Style.css file, and
+ * pre-process if necessary. Remove file from copy list if not changed.
+ * 4) If there are files in the copy list (there is a change), empty the public
+ * www directory and either copy the files or create a compiled file.
*/
public function __construct($config) {
// For production sites, any un-compiled scripts that exist in the
|
Started re-implementing FileOrganiser for #<I>
|
diff --git a/lib/dml/mysqli_native_moodle_database.php b/lib/dml/mysqli_native_moodle_database.php
index <HASH>..<HASH> 100644
--- a/lib/dml/mysqli_native_moodle_database.php
+++ b/lib/dml/mysqli_native_moodle_database.php
@@ -853,8 +853,8 @@ class mysqli_native_moodle_database extends moodle_database {
return $sql;
}
// ok, we have verified sql statement with ? and correct number of params
- $parts = explode('?', $sql);
- $return = array_shift($parts);
+ $parts = array_reverse(explode('?', $sql));
+ $return = array_pop($parts);
foreach ($params as $param) {
if (is_bool($param)) {
$return .= (int)$param;
@@ -868,7 +868,7 @@ class mysqli_native_moodle_database extends moodle_database {
$param = $this->mysqli->real_escape_string($param);
$return .= "'$param'";
}
- $return .= array_shift($parts);
+ $return .= array_pop($parts);
}
return $return;
}
|
MDL-<I> improve emulate_bound_params() for mysqli
Looping over large numbers of items with array_shift() is expensive.
Reverse the array and fetch items from the top of the pile.
|
diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -161,7 +161,14 @@ class DissectHtml {
babelJs(js) {
try {
return Babel.transform(js, {
- presets: ['es2015']
+ presets: [
+ ['es2015',
+ {
+ modules: false,
+ blacklist: ['useStrict']
+ },
+ ]
+ ]
}).code
} catch (err) {
console.error(`Error in ${this.path}`) // eslint-disable-line no-console
|
babel blacklist use strict. #9
|
diff --git a/Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/DiscreteMovementCommandsImplementation.java b/Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/DiscreteMovementCommandsImplementation.java
index <HASH>..<HASH> 100755
--- a/Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/DiscreteMovementCommandsImplementation.java
+++ b/Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/DiscreteMovementCommandsImplementation.java
@@ -112,8 +112,8 @@ public class DiscreteMovementCommandsImplementation extends CommandBase implemen
double newX = player.posX;
double newZ = player.posZ;
// Are we still in the centre of a square, or did we get shunted?
- double desiredX = ((int)(Math.abs(newX)) + 0.5) * (newX >= 0 ? 1 : -1);
- double desiredZ = ((int)(Math.abs(newZ)) + 0.5) * (newZ >= 0 ? 1 : -1);
+ double desiredX = Math.floor(newX) + 0.5;
+ double desiredZ = Math.floor(newZ) + 0.5;
double deltaX = desiredX - newX;
double deltaZ = desiredZ - newZ;
if (deltaX * deltaX + deltaZ * deltaZ > 0.001)
|
Less stupid fix for discrete -ve movement.
|
diff --git a/spec/viewport_spec.rb b/spec/viewport_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/viewport_spec.rb
+++ b/spec/viewport_spec.rb
@@ -8,6 +8,6 @@ describe Remedy::Viewport do
joke << "A: Purple, because ice cream has no bones!"
screen = ::Remedy::Viewport.new
- screen.draw joke
+ screen.draw joke unless ENV['CI']
end
end
|
Don't actually execute draw if we're on CI, since it will break.
|
diff --git a/lib/test-server/client/slave-client.js b/lib/test-server/client/slave-client.js
index <HASH>..<HASH> 100644
--- a/lib/test-server/client/slave-client.js
+++ b/lib/test-server/client/slave-client.js
@@ -251,7 +251,8 @@
var replaceConsoleFunction = function (console, name, scope) {
var oldFunction = config.localConsole === false ? emptyFunction : console[name] || emptyFunction;
console[name] = function () {
- var res = oldFunction.apply(this, arguments);
+ // IE < 9 compatible: http://stackoverflow.com/questions/5538972/console-log-apply-not-working-in-ie9#comment8444540_5539378
+ var res = Function.prototype.apply.call(oldFunction, this, arguments);
var taskExecutionId = scope.__taskExecutionId;
if (!currentTask || currentTask.taskExecutionId !== taskExecutionId) {
taskExecutionId = -1;
|
fix #<I> On IE versions older than 9 native methods on the "console" object don't have an "apply" method
The workaround is to call the generic "apply" (from "Function"'s prototype) using its own "call" method with proper arguments.
|
diff --git a/lib/branch_io_cli/command/report_command.rb b/lib/branch_io_cli/command/report_command.rb
index <HASH>..<HASH> 100644
--- a/lib/branch_io_cli/command/report_command.rb
+++ b/lib/branch_io_cli/command/report_command.rb
@@ -294,16 +294,9 @@ EOF
# String containing information relevant to Branch setup
def branch_report
- bundle_identifier = helper.expanded_build_setting config.target, "PRODUCT_BUNDLE_IDENTIFIER", config.configuration
- dev_team = helper.expanded_build_setting config.target, "DEVELOPMENT_TEAM", config.configuration
infoplist_path = helper.expanded_build_setting config.target, "INFOPLIST_FILE", config.configuration
- entitlements_path = helper.expanded_build_setting config.target, "CODE_SIGN_ENTITLEMENTS", config.configuration
report = "Branch configuration:\n"
- report += " PRODUCT_BUNDLE_IDENTIFIER = #{bundle_identifier.inspect}\n"
- report += " DEVELOPMENT_TEAM = #{dev_team.inspect}\n"
- report += " INFOPLIST_PATH = #{infoplist_path.inspect}\n"
- report += " CODE_SIGN_ENTITLEMENTS = #{entitlements_path.inspect}\n"
begin
info_plist = File.open(infoplist_path) { |f| Plist.parse_xml f }
|
Removed some things from the Branch report
|
diff --git a/lib/launchy/application.rb b/lib/launchy/application.rb
index <HASH>..<HASH> 100644
--- a/lib/launchy/application.rb
+++ b/lib/launchy/application.rb
@@ -148,14 +148,11 @@ module Launchy
if my_os_family == :windows then
# NOTE: the command is purposely omitted here because
- # running the filename via "cmd /c" is the same as
- # running "start filename" at the command-prompt
- #
- # furthermore, when "cmd /c start filename" is
+ # When "cmd /c start filename" is
# run, the shell interprets it as two commands:
# (1) "start" opens a new terminal, and (2)
# "filename" causes the file to be launched.
- system 'cmd', '/c', *args
+ system 'cmd', '/c', cmd, *args
else
# fork, and the child process should NOT run any exit handlers
child_pid = fork do
|
Fixed a bug in launching a browser in Windows
|
diff --git a/lib/picker.js b/lib/picker.js
index <HASH>..<HASH> 100644
--- a/lib/picker.js
+++ b/lib/picker.js
@@ -274,7 +274,9 @@ function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {
// * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,
// which causes the picker to unexpectedly close when right-clicking it. So make
// sure the event wasn’t a right-click.
- if ( target != ELEMENT && target != document && event.which != 3 ) {
+ // * In Chrome 62 and up, password autofill causes a simulated focusin event which
+ // closes the picker.
+ if ( ! event.isSimulated && target != ELEMENT && target != document && event.which != 3 ) {
// If the target was the holder that covers the screen,
// keep the element focused to maintain tabindex.
|
Prevent Chrome <I> autofill from closing the picker
Closes #<I>
Thanks go to @Mwni for finding a solution
|
diff --git a/pkg/registry/service/rest_test.go b/pkg/registry/service/rest_test.go
index <HASH>..<HASH> 100644
--- a/pkg/registry/service/rest_test.go
+++ b/pkg/registry/service/rest_test.go
@@ -569,6 +569,7 @@ func TestServiceRegistryIPAllocation(t *testing.T) {
for _, ip := range testIPs {
if !rest.serviceIPs.(*ipallocator.Range).Has(net.ParseIP(ip)) {
testIP = ip
+ break
}
}
@@ -687,9 +688,18 @@ func TestServiceRegistryIPUpdate(t *testing.T) {
t.Errorf("Expected port 6503, but got %v", updated_service.Spec.Ports[0].Port)
}
+ testIPs := []string{"1.2.3.93", "1.2.3.94", "1.2.3.95", "1.2.3.96"}
+ testIP := ""
+ for _, ip := range testIPs {
+ if !rest.serviceIPs.(*ipallocator.Range).Has(net.ParseIP(ip)) {
+ testIP = ip
+ break
+ }
+ }
+
update = deepCloneService(created_service)
update.Spec.Ports[0].Port = 6503
- update.Spec.ClusterIP = "1.2.3.76" // error
+ update.Spec.ClusterIP = testIP // Error: Cluster IP is immutable
_, _, err := rest.Update(ctx, update)
if err == nil || !errors.IsInvalid(err) {
|
Fix the issue which TestServiceRegistryIPUpdate will randomly run failed.
|
diff --git a/lib/active_mocker/display_errors.rb b/lib/active_mocker/display_errors.rb
index <HASH>..<HASH> 100644
--- a/lib/active_mocker/display_errors.rb
+++ b/lib/active_mocker/display_errors.rb
@@ -68,12 +68,3 @@ module ActiveMocker
end
end
end
-
-class String
- def colorize(*args)
- require "colorize"
- super(*args)
- rescue LoadError
- self
- end
-end
|
Remove hack for String#colorize that would cause the error: "NoMethodError: super: no superclass method `colorize' for #<String>"
|
diff --git a/go/test/endtoend/vtgate/queries/union/main_test.go b/go/test/endtoend/vtgate/queries/union/main_test.go
index <HASH>..<HASH> 100644
--- a/go/test/endtoend/vtgate/queries/union/main_test.go
+++ b/go/test/endtoend/vtgate/queries/union/main_test.go
@@ -28,8 +28,8 @@ import (
var (
clusterInstance *cluster.LocalProcessCluster
vtParams mysql.ConnParams
- KeyspaceName = "ks"
- Cell = "test"
+ KeyspaceName = "ks_union"
+ Cell = "test_union"
SchemaSQL = `create table t1(
id1 bigint,
id2 bigint,
@@ -156,11 +156,6 @@ func TestMain(m *testing.M) {
return 1
}
- err = clusterInstance.VtctlclientProcess.ExecuteCommand("RebuildVSchemaGraph")
- if err != nil {
- return 1
- }
-
clusterInstance.VtGateExtraArgs = append(clusterInstance.VtGateExtraArgs, "-enable_system_settings=true")
// Start vtgate
err = clusterInstance.StartVtgate()
|
Removed build keyspace graph from union main test
|
diff --git a/config/configuration.js b/config/configuration.js
index <HASH>..<HASH> 100644
--- a/config/configuration.js
+++ b/config/configuration.js
@@ -7,7 +7,7 @@ var node_env = process.env.NODE_ENV || "development";
var default_port = 8000;
var default_tika_version = '1.4';
-var default_tika_path = "/etc/tika-" + default_tika_version;
+var default_tika_path = "/etc/tika-" + default_tika_version + "tika-app-" + default_tika_version + ".jar";
if(node_env === "production") {
default_port = 80;
|
Updated default tika_path
|
diff --git a/infrastructure.go b/infrastructure.go
index <HASH>..<HASH> 100644
--- a/infrastructure.go
+++ b/infrastructure.go
@@ -1211,8 +1211,6 @@ func New(config *ConnConfig, ntfnHandlers *NotificationHandlers) (*Client, error
start = true
}
}
- log.Infof("Established connection to RPC server %s",
- config.Host)
client := &Client{
config: config,
@@ -1230,6 +1228,8 @@ func New(config *ConnConfig, ntfnHandlers *NotificationHandlers) (*Client, error
}
if start {
+ log.Infof("Established connection to RPC server %s",
+ config.Host)
close(connEstablished)
client.start()
if !client.config.HTTPPostMode && !client.config.DisableAutoReconnect {
@@ -1282,6 +1282,8 @@ func (c *Client) Connect(tries int) error {
// Connection was established. Set the websocket connection
// member of the client and start the goroutines necessary
// to run the client.
+ log.Infof("Established connection to RPC server %s",
+ c.config.Host)
c.wsConn = wsConn
close(c.connEstablished)
c.start()
|
Fix "Established connection" log message.
Don't log "Established connection" message on new when
DisableConnectOnNew is set and no connection was actually established.
Do log that same message when Connect() successfully connects.
|
diff --git a/lib/celerity/element_locator.rb b/lib/celerity/element_locator.rb
index <HASH>..<HASH> 100644
--- a/lib/celerity/element_locator.rb
+++ b/lib/celerity/element_locator.rb
@@ -77,13 +77,13 @@ module Celerity
def find_by_id(what)
case what
when Regexp
- elements_by_tag_names.find { |elem| elem.getIdAttribute =~ what }
+ elements_by_tag_names.find { |elem| elem.getId =~ what }
when String
obj = @object.getHtmlElementById(what)
return obj if @tags.include?(obj.getTagName)
$stderr.puts "warning: multiple elements with identical id? (#{what.inspect})" if $VERBOSE
- elements_by_tag_names.find { |elem| elem.getIdAttribute == what }
+ elements_by_tag_names.find { |elem| elem.getId == what }
else
raise TypeError, "expected String or Regexp, got #{what.inspect}:#{what.class}"
end
|
Fix spec failure when locating elements by id (caused by <I> API changes)
|
diff --git a/tests/func/experiments/test_queue.py b/tests/func/experiments/test_queue.py
index <HASH>..<HASH> 100644
--- a/tests/func/experiments/test_queue.py
+++ b/tests/func/experiments/test_queue.py
@@ -42,6 +42,7 @@ def failed_tasks(tmp_dir, dvc, scm, test_queue, failed_exp_stage):
return name_list
+@pytest.mark.xfail(strict=False, reason="pytest-celery flaky")
@pytest.mark.parametrize("follow", [True, False])
def test_celery_logs(
tmp_dir,
@@ -64,7 +65,7 @@ def test_celery_logs(
assert "failed to reproduce 'failed-copy-file'" in captured.out
-@pytest.mark.flaky(max_runs=3, min_passes=1)
+@pytest.mark.xfail(strict=False, reason="pytest-celery flaky")
def test_queue_remove_done(dvc, failed_tasks, success_tasks):
assert len(dvc.experiments.celery_queue.failed_stash) == 3
status = to_dict(dvc.experiments.celery_queue.status())
|
tests: mark exp queue func tests xfail (#<I>)
|
diff --git a/src/java/liquibase/ext/mssql/change/LoadDataChangeMSSQL.java b/src/java/liquibase/ext/mssql/change/LoadDataChangeMSSQL.java
index <HASH>..<HASH> 100644
--- a/src/java/liquibase/ext/mssql/change/LoadDataChangeMSSQL.java
+++ b/src/java/liquibase/ext/mssql/change/LoadDataChangeMSSQL.java
@@ -10,7 +10,7 @@ import liquibase.ext.mssql.statement.InsertStatementMSSQL;
import liquibase.statement.SqlStatement;
import liquibase.statement.core.InsertStatement;
-@DatabaseChange(name = "loadData", description = "Load Data", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "table")
+@DatabaseChange(name = "loadData", description = "Load Data", priority = ChangeMetaData.PRIORITY_DATABASE, appliesTo = "table")
public class LoadDataChangeMSSQL extends liquibase.change.core.LoadDataChange {
private Boolean identityInsertEnabled;
|
bugfix: increased LoadDataChangeMSSQL priority
|
diff --git a/src/Ups.php b/src/Ups.php
index <HASH>..<HASH> 100644
--- a/src/Ups.php
+++ b/src/Ups.php
@@ -139,7 +139,11 @@ abstract class Ups implements LoggerAwareInterface
$accessRequest->appendChild($xml->createElement('AccessLicenseNumber', $this->accessKey));
$accessRequest->appendChild($xml->createElement('UserId', $this->userId));
- $accessRequest->appendChild($xml->createElement('Password', $this->password));
+ //$accessRequest->appendChild($xml->createElement('Password'));
+ // $accessRequest->appendChild($xml->createTextNode($this->password));
+
+ $p = $accessRequest->appendChild($xml->createElement('Password'));
+ $p->appendChild($xml->createTextNode($this->password));
return $xml->saveXML();
}
|
Fixed issue with passwords contains !
|
diff --git a/test/HTMLCollection.test.php b/test/HTMLCollection.test.php
index <HASH>..<HASH> 100644
--- a/test/HTMLCollection.test.php
+++ b/test/HTMLCollection.test.php
@@ -20,4 +20,14 @@ public function testNonElementsRemoved() {
$this->assertInstanceOf("\phpgt\dom\Element", $bodyChildren->item(0));
}
+public function testFormsPropertyWhenNoForms() {
+ $documentWithout = new HTMLDocument(test\Helper::HTML);
+ $this->assertEquals(0, $documentWithout->forms->length);
+}
+
+public function testFormsPropertyWhenForms() {
+ $documentWith = new HTMLDocument(test\Helper::HTML_MORE);
+ $this->assertEquals(2, $documentWith->forms->length);
+}
+
}#
\ No newline at end of file
diff --git a/test/Helper.php b/test/Helper.php
index <HASH>..<HASH> 100644
--- a/test/Helper.php
+++ b/test/Helper.php
@@ -21,6 +21,13 @@ const HTML_MORE = <<<HTML
<a href="https://twitter.com/g105b">Greg Bowler</a> started this project
to bring modern DOM techniques to the server side.
</p>
+ <form>
+ <input name="fieldA" type="text">
+ <button type="submit">Submit</button>
+ </form>
+ <form>
+ <input name="fieldB" type="text">
+ </form>
</body>
HTML;
|
Add tests for HTMLDocument->forms property
|
diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java
index <HASH>..<HASH> 100644
--- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java
+++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java
@@ -467,7 +467,6 @@ public class RxDocumentClientImpl implements AsyncDocumentClient, IAuthorization
} else {
this.initializeDirectConnectivity();
}
- this.queryPlanCache = new ConcurrentHashMap<>();
this.retryPolicy.setRxCollectionCache(this.collectionCache);
} catch (Exception e) {
logger.error("unexpected failure in initializing client.", e);
|
Fix query plan cache initialization (#<I>)
* Fix query plan cache initialization
* Update sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java
Removing the cache intialization from init method.
|
diff --git a/vendor/seahorse/spec/seahorse/client/configuration_spec.rb b/vendor/seahorse/spec/seahorse/client/configuration_spec.rb
index <HASH>..<HASH> 100644
--- a/vendor/seahorse/spec/seahorse/client/configuration_spec.rb
+++ b/vendor/seahorse/spec/seahorse/client/configuration_spec.rb
@@ -103,6 +103,19 @@ module Seahorse
expect(config.build!.proc).to be(value)
end
+ it 'resolves defaults in LIFO order until a non-nil value is found' do
+ # default cost is 10
+ config.add_option(:cost) { 10 }
+
+ # increase cost for red items
+ config.add_option(:cost) { |cfg| cfg.color == 'red' ? 9001 : nil }
+
+ config.add_option(:color)
+
+ expect(config.build!(color: 'green').cost).to eq(10)
+ expect(config.build!(color: 'red').cost).to eq(9001) # over 9000!
+ end
+
end
end
end
|
Added a spec for ensuring default configuration values resolve until a non-nil value is found.
|
diff --git a/Malmo/samples/Python_examples/tabular_q_learning.py b/Malmo/samples/Python_examples/tabular_q_learning.py
index <HASH>..<HASH> 100755
--- a/Malmo/samples/Python_examples/tabular_q_learning.py
+++ b/Malmo/samples/Python_examples/tabular_q_learning.py
@@ -126,7 +126,9 @@ class TabQAgent:
world_state = agent_host.peekWorldState()
while world_state.is_mission_running and all(e.text=='{}' for e in world_state.observations):
world_state = agent_host.peekWorldState()
- world_state = agent_host.getWorldState()
+ world_state = agent_host.getWorldState()
+ for err in world_state.errors:
+ print err
if not world_state.is_mission_running:
return 0 # mission already ended
@@ -158,6 +160,8 @@ class TabQAgent:
break
world_state = agent_host.getWorldState()
+ for err in world_state.errors:
+ print err
current_r = sum(r.getValue() for r in world_state.rewards)
if world_state.is_mission_running:
|
Minor: printing any errors received is good practice.
|
diff --git a/spec/researches/fleschReadingSpec.js b/spec/researches/fleschReadingSpec.js
index <HASH>..<HASH> 100644
--- a/spec/researches/fleschReadingSpec.js
+++ b/spec/researches/fleschReadingSpec.js
@@ -7,7 +7,6 @@ describe("a test to calculate the fleschReading score", function(){
var mockPaper = new Paper( "A piece of text to calculate scores." );
expect( fleschFunction( mockPaper ) ).toBe( 78.9 );
-// todo This spec is currently disabled, because the fleschreading still runs a cleantext, that removes capitals. This is fixed in #496 of YoastSEO
mockPaper = new Paper( "One question we get quite often in our website reviews is whether we can help people recover from the drop they noticed in their rankings or traffic. A lot of the times, this is a legitimate drop and people were actually in a bit of trouble" );
expect( fleschFunction( mockPaper )).toBe( 63.9 );
|
Removes todo from spec
|
diff --git a/openid/consumer/consumer.py b/openid/consumer/consumer.py
index <HASH>..<HASH> 100644
--- a/openid/consumer/consumer.py
+++ b/openid/consumer/consumer.py
@@ -446,10 +446,12 @@ class GenericConsumer(object):
(identity_url, delegate, server_url) = pieces
- if yadis_available and xri.identifierScheme(identity_url) == 'XRI':
+ if (identity_url and yadis_available
+ and xri.identifierScheme(identity_url) == 'XRI'):
identity_url = unicode(identity_url, 'utf-8')
- if yadis_available and xri.identifierScheme(delegate) == 'XRI':
+ if (delegate and yadis_available
+ and xri.identifierScheme(delegate) == 'XRI'):
delegate = unicode(delegate, 'utf-8')
if mode == 'cancel':
|
[project @ Handle error conditions better in complete.]
|
diff --git a/Repository/ResourceQueryBuilder.php b/Repository/ResourceQueryBuilder.php
index <HASH>..<HASH> 100644
--- a/Repository/ResourceQueryBuilder.php
+++ b/Repository/ResourceQueryBuilder.php
@@ -399,10 +399,10 @@ class ResourceQueryBuilder
/**
* Filters nodes that are published.
*
- * @param $user
+ * @param $user (not typing because we don't want anon. to crash everything)
* @return ResourceQueryBuilder
*/
- public function whereIsAccessible(UserInterface $user)
+ public function whereIsAccessible($user)
{
$currentDate = new \DateTime();
$clause = '(
|
[CoreBundle] Fixing view as for resource manager.
|
diff --git a/bika/lims/upgrade/to1117.py b/bika/lims/upgrade/to1117.py
index <HASH>..<HASH> 100644
--- a/bika/lims/upgrade/to1117.py
+++ b/bika/lims/upgrade/to1117.py
@@ -9,4 +9,5 @@ def upgrade(tool):
portal = aq_parent(aq_inner(tool))
setup = portal.portal_setup
- setup.runImportStepFromProfile('profile-bika.lims:default', 'portlets')
+ setup.runImportStepFromProfile('profile-bika.lims:default', 'portlets',
+ run_dependencies=False)
|
Upgrade <I> - add run_dependencies=False
Somehow re-importing the 'portlets' step, causes
a beforeDelete handler to fail a HoldingReference
check.
|
diff --git a/src/Illuminate/Support/helpers.php b/src/Illuminate/Support/helpers.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Support/helpers.php
+++ b/src/Illuminate/Support/helpers.php
@@ -476,18 +476,23 @@ if ( ! function_exists('env'))
{
$value = getenv($key);
- switch (strtolower($value)) {
+ switch (strtolower($value))
+ {
case 'true':
case '(true)':
return true;
+
case 'false':
case '(false)':
return false;
+
case '(null)':
return null;
+
case '(empty)':
return '';
}
+
return $value;
}
}
|
Fixing a few formatting things.
|
diff --git a/test/daemon_runner/shell_out_test.rb b/test/daemon_runner/shell_out_test.rb
index <HASH>..<HASH> 100644
--- a/test/daemon_runner/shell_out_test.rb
+++ b/test/daemon_runner/shell_out_test.rb
@@ -94,7 +94,7 @@ class ShellOutTest < Minitest::Test
assert_equal [1], shellout.valid_exit_codes
end
- def test_returns_nil_if_waiting_without_child_process
+ def test_wait2_returns_nil_if_waiting_without_child_process
wait2 = lambda { |pid, flags| raise Errno::ECHILD }
Process.stub :wait2, wait2 do
@@ -103,7 +103,7 @@ class ShellOutTest < Minitest::Test
end
end
- def test_returns_nil_if_pid_is_not_provided
+ def test_wait2_returns_nil_if_pid_is_not_provided
result = ::DaemonRunner::ShellOut.wait2
assert_equal nil, result
end
|
Provide better test names for wait2 tests.
|
diff --git a/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php b/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php
+++ b/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php
@@ -289,8 +289,9 @@ class ManyToManyPersister extends AbstractCollectionPersister
}
}
- $sql = implode(' AND ', $filterClauses);
- return $sql ? '(' . $sql . ')' : '';
+ return $filterClauses
+ ? '(' . implode(' AND ', $filterClauses) . ')'
+ : '';
}
/**
|
#<I> DDC-<I> - removed unused assignment, direct return instead
|
diff --git a/test/test.js b/test/test.js
index <HASH>..<HASH> 100644
--- a/test/test.js
+++ b/test/test.js
@@ -551,6 +551,22 @@ describe('S3rver Tests', function () {
});
});
+
+ it('should list objects in a bucket filtered by a prefix 2', function (done) {
+ s3Client.listObjectsV2({ 'Bucket': buckets[1], Prefix: 'key' }, function (err, objects) {
+ if (err) {
+ return done(err)
+ }
+ should(objects.Contents.length).equal(4);
+ should.exist(_.find(objects.Contents, {'Key': 'key1'}));
+ should.exist(_.find(objects.Contents, {'Key': 'key2'}));
+ should.exist(_.find(objects.Contents, {'Key': 'key3'}));
+ should.exist(_.find(objects.Contents, {'Key': 'key/key1'}));
+ done();
+ })
+ })
+
+
it('should list objects in a bucket filtered by a marker', function (done) {
s3Client.listObjects({'Bucket': buckets[1], Marker: 'akey3'}, function (err, objects) {
if (err) {
|
test(listObjects): Adds test for issue #<I>
|
diff --git a/terms/html.py b/terms/html.py
index <HASH>..<HASH> 100644
--- a/terms/html.py
+++ b/terms/html.py
@@ -73,8 +73,8 @@ def get_interesting_contents(parent_node, replace_regexp):
if TERMS_ENABLED:
- def replace_terms(html):
- html = force_text(html)
+ def replace_terms(original_html):
+ html = force_text(original_html)
if not html:
return html
remove_body = False
@@ -93,7 +93,12 @@ if TERMS_ENABLED:
replace_regexp__sub = replace_regexp.sub
translate = get_translate_function(replace_dict, variants_dict)
- for node in get_interesting_contents(root_node, replace_regexp):
+ interesting_contents = list(get_interesting_contents(root_node,
+ replace_regexp))
+ if not interesting_contents:
+ return original_html
+
+ for node in interesting_contents:
new_content = replace_regexp__sub(
translate, tostring(node, encoding='unicode'))
new_node = parse(StringIO(new_content)).getroot().getchildren()[0]
|
If nothing interesting is found, return the original HTML instead of rebuilding it.
|
diff --git a/storage/src/main/java/de/citec/jul/storage/registry/Registry.java b/storage/src/main/java/de/citec/jul/storage/registry/Registry.java
index <HASH>..<HASH> 100644
--- a/storage/src/main/java/de/citec/jul/storage/registry/Registry.java
+++ b/storage/src/main/java/de/citec/jul/storage/registry/Registry.java
@@ -159,7 +159,7 @@ public class Registry<KEY, VALUE extends Identifiable<KEY>> extends Observable<M
synchronized (SYNC) {
int interationCounter = 0;
boolean valid = false;
- while (!valid) {
+ while (!valid && !consistencyHandlerList.isEmpty()) {
for (ConsistencyHandler consistencyHandler : consistencyHandlerList) {
try {
valid &= !consistencyHandler.processData(registry, this);
|
handle wrong consistency handling in case no handler is registered.
|
diff --git a/escpos/config.py b/escpos/config.py
index <HASH>..<HASH> 100644
--- a/escpos/config.py
+++ b/escpos/config.py
@@ -27,8 +27,7 @@ class Config(object):
)
try:
- with open(config_path) as f:
- config = yaml.load(f)
+ config = yaml.safe_load(f)
except EnvironmentError as e:
raise exceptions.ConfigNotFoundError('Couldn\'t read config at one or more of {config_path}'.format(
config_path="\n".join(config_path),
|
Convert to safe load. Also now allows loading everyting pyyaml supports
|
diff --git a/cmd/daily-lifecycle-ops.go b/cmd/daily-lifecycle-ops.go
index <HASH>..<HASH> 100644
--- a/cmd/daily-lifecycle-ops.go
+++ b/cmd/daily-lifecycle-ops.go
@@ -44,22 +44,12 @@ func startDailyLifecycle(ctx context.Context, objAPI ObjectLayer) {
return
case <-time.NewTimer(bgLifecycleInterval).C:
// Perform one lifecycle operation
- err := lifecycleRound(ctx, objAPI)
- switch err.(type) {
- case OperationTimedOut:
- // Unable to hold a lock means there is another
- // caller holding write lock, ignore and try next round.
- continue
- default:
- logger.LogIf(ctx, err)
- }
+ logger.LogIf(ctx, lifecycleRound(ctx, objAPI))
}
}
}
-var lifecycleLockTimeout = newDynamicTimeout(60*time.Second, time.Second)
-
func lifecycleRound(ctx context.Context, objAPI ObjectLayer) error {
buckets, err := objAPI.ListBuckets(ctx)
if err != nil {
|
fix: cleanup lifecycle unused code (#<I>)
|
diff --git a/Zebra_Database.php b/Zebra_Database.php
index <HASH>..<HASH> 100644
--- a/Zebra_Database.php
+++ b/Zebra_Database.php
@@ -633,6 +633,8 @@ class Zebra_Database
'user' => $user,
'password' => $password,
'database' => $database,
+ 'port' => $port == '' ? ini_get('mysqli.default_port') : $port,
+ 'socket' => $socket == '' ? ini_get('mysqli.default_socket') : $socket,
);
// connect now, if we need to connect right away
@@ -4184,7 +4186,9 @@ class Zebra_Database
$this->credentials['host'],
$this->credentials['user'],
$this->credentials['password'],
- $this->credentials['database']
+ $this->credentials['database'],
+ $this->credentials['port'],
+ $this->credentials['socket']
);
// tries to connect to the MySQL database
|
Fixed port and socket not used even if set
Thanks to Nam Trung for reporting
|
diff --git a/lib/minify.js b/lib/minify.js
index <HASH>..<HASH> 100644
--- a/lib/minify.js
+++ b/lib/minify.js
@@ -30,10 +30,10 @@
function check(name, callback) {
if (!name)
- throw(Error('name could not be empty!'));
+ throw Error('name could not be empty!');
if (typeof callback !== 'function')
- throw(Error('callback should be function!'));
+ throw Error('callback should be function!');
}
function minify(name, options, callback) {
|
chore(minify) throw() -> throw
|
diff --git a/tests/asm/test_risks.py b/tests/asm/test_risks.py
index <HASH>..<HASH> 100644
--- a/tests/asm/test_risks.py
+++ b/tests/asm/test_risks.py
@@ -125,7 +125,7 @@ TEST_RISK_TYPE_JSON = {
"type": "string",
}
TEST_RISK_TYPES_JSON = {
- "constants": [TEST_RISK_TYPE_JSON],
+ "type": [TEST_RISK_TYPE_JSON],
}
TEST_PATCH_RISK_TYPE_JSON = {
"changes": 0,
|
fix:update language to match pipeline/discover
|
diff --git a/demo/http.php b/demo/http.php
index <HASH>..<HASH> 100644
--- a/demo/http.php
+++ b/demo/http.php
@@ -6,4 +6,24 @@ if (isset($_GET['sleep'])) {
sleep(10);
}
+if (isset($_GET['img'])) {
+ $fp = fopen(__DIR__ . '/../website/template/img/logo-small.png', 'rb');
+ header('Content-Type: image/png');
+ header('Content-Length: ' . filesize(__DIR__ . '/logo.png'));
+ fpassthru($fp);
+ exit(0);
+}
+
+if (isset($_GET['json'])) {
+ header('Content-Type: application/json');
+ echo json_encode(['Hello' => '🌍']);
+ exit(0);
+}
+
+if (isset($_GET['weird'])) {
+ header('Content-Type: foo/bar');
+ echo 'Hello 🌍';
+ exit(0);
+}
+
echo 'Hello world!';
|
Add cases to manually test #<I>
|
diff --git a/gui/src/main/java/org/jboss/as/console/client/domain/model/impl/HostInfoStoreImpl.java b/gui/src/main/java/org/jboss/as/console/client/domain/model/impl/HostInfoStoreImpl.java
index <HASH>..<HASH> 100644
--- a/gui/src/main/java/org/jboss/as/console/client/domain/model/impl/HostInfoStoreImpl.java
+++ b/gui/src/main/java/org/jboss/as/console/client/domain/model/impl/HostInfoStoreImpl.java
@@ -329,7 +329,7 @@ public class HostInfoStoreImpl implements HostInformationStore {
numRequests++;
- dispatcher.execute(new DMRAction(operation), new SimpleCallback<DMRResponse>() {
+ dispatcher.execute(new DMRAction(operation, false), new SimpleCallback<DMRResponse>() {
@Override
|
don't use caching when fetching server instances
|
diff --git a/Core/Listener/PackageInstalledListener.php b/Core/Listener/PackageInstalledListener.php
index <HASH>..<HASH> 100644
--- a/Core/Listener/PackageInstalledListener.php
+++ b/Core/Listener/PackageInstalledListener.php
@@ -28,13 +28,14 @@ use Symfony\Component\Process\Process;
class PackageInstalledListener
{
public function onPackageInstalled(PackageInstalledEvent $event)
- {
+ {
chdir(__DIR__ . '/../../');
$process = new Process('git submodule init');
$process->run();
$process = new Process('git submodule update');
- $process->run();
+ $res = $process->run();
+ if($res === 0) $event->setSuccess (true);
}
}
|
Valorized the event listener success param, according with the operation result
|
diff --git a/src/zgor/ZSprite.js b/src/zgor/ZSprite.js
index <HASH>..<HASH> 100644
--- a/src/zgor/ZSprite.js
+++ b/src/zgor/ZSprite.js
@@ -390,36 +390,6 @@ zgor.ZSprite.prototype.getElement = function()
};
/**
- * @override
- * @public
- */
-zgor.ZSprite.prototype.onAddedToStage = function()
-{
- // inherited from interface
-};
-
-/**
- * @override
- * @public
- */
-zgor.ZSprite.prototype.onRemovedFromStage = function()
-{
- // inherited from interface
-};
-
-/**
- * @public
- * @param {boolean} aValue whether to use event bubbling
- */
-zgor.ZSprite.prototype.setEventBubbling = function( aValue )
-{
- this._useEventBubbling = aValue;
-
- // will update event bubbling status in case Sprite has a parent container
- this.setParent( this._parent, this._useEventBubbling );
-};
-
-/**
* set a reference to the parent sprite containing this one
*
* @override
|
removed rudimentary event methods from zSprite
|
diff --git a/torrent.go b/torrent.go
index <HASH>..<HASH> 100644
--- a/torrent.go
+++ b/torrent.go
@@ -387,6 +387,8 @@ func (t *Torrent) cacheLength() {
t.length = &l
}
+// TODO: This shouldn't fail for storage reasons. Instead we should handle storage failure
+// separately.
func (t *Torrent) setInfo(info *metainfo.Info) error {
if err := validateInfo(info); err != nil {
return fmt.Errorf("bad info: %s", err)
@@ -1193,8 +1195,9 @@ func (t *Torrent) readAt(b []byte, off int64) (n int, err error) {
return
}
-// Returns an error if the metadata was completed, but couldn't be set for
-// some reason. Blame it on the last peer to contribute.
+// Returns an error if the metadata was completed, but couldn't be set for some reason. Blame it on
+// the last peer to contribute. TODO: Actually we shouldn't blame peers for failure to open storage
+// etc. Also we should probably cached metadata pieces per-Peer, to isolate failure appropriately.
func (t *Torrent) maybeCompleteMetadata() error {
if t.haveInfo() {
// Nothing to do.
|
Add TODOs around setting info bytes
|
diff --git a/biocommons/seqrepo/fastadir/fastadir.py b/biocommons/seqrepo/fastadir/fastadir.py
index <HASH>..<HASH> 100644
--- a/biocommons/seqrepo/fastadir/fastadir.py
+++ b/biocommons/seqrepo/fastadir/fastadir.py
@@ -88,7 +88,7 @@ class FastaDir(BaseReader, BaseWriter):
yield recd
def __len__(self):
- return self.stats()["n_seqs"]
+ return self.stats()["n_sequences"]
# ############################################################################
# Public methods
diff --git a/tests/test_fastadir.py b/tests/test_fastadir.py
index <HASH>..<HASH> 100644
--- a/tests/test_fastadir.py
+++ b/tests/test_fastadir.py
@@ -23,6 +23,8 @@ def test_write_reread():
assert "3" in fd
+ assert len(fd) == 3
+
assert fd["3"] == "seq3", "test __getitem__ lookup"
with pytest.raises(KeyError):
|
fixed KeyError in FastaDir.__len__ and added test
|
diff --git a/lib/config.js b/lib/config.js
index <HASH>..<HASH> 100644
--- a/lib/config.js
+++ b/lib/config.js
@@ -64,9 +64,9 @@ function importEnvVars(collection, envPrefix) {
envValue = process.env[envKey];
if ((typeof(value) == 'number') || (typeof(value) == 'string') || (typeof(value) == 'boolean') || (value == null)) {
if (envValue && typeof(envValue == 'string')) {
- if (envValue.match(/\s*(true|on)\s*/i)) {
+ if (envValue.match(/^\s*(true|on)\s*$/i)) {
envValue = true;
- } else if (envValue.match(/\s*(false|off)\s*/i)) {
+ } else if (envValue.match(/^\s*(false|off)\s*$/i)) {
envValue = false;
}
collection[key] = envValue;
@@ -79,4 +79,4 @@ function importEnvVars(collection, envPrefix) {
}
importEnvVars(config, 'JSBIN');
-module.exports = config;
\ No newline at end of file
+module.exports = config;
|
Make the config environment variable override mechanism support environment variables that contain true/on or false/off.
|
diff --git a/pygccxml/parser/scanner.py b/pygccxml/parser/scanner.py
index <HASH>..<HASH> 100644
--- a/pygccxml/parser/scanner.py
+++ b/pygccxml/parser/scanner.py
@@ -218,11 +218,9 @@ class scanner_t(xml.sax.handler.ContentHandler):
file_text = self.__files_text.get(file_decl)
# Use lines and columns to capture only comment text
for indx in range(comm_decl.begin_line - 1, comm_decl.end_line):
- # Col data only useful on first and last lines
- strt_idx = 0
+ # Col data only different on the last line
end_idx = -1
- if indx == comm_decl.begin_line - 1:
- strt_idx = comm_decl.begin_column - 1
+ strt_idx = comm_decl.begin_column - 1
if indx == comm_decl.end_line - 1:
end_idx = comm_decl.end_column
comm_line = file_text[indx]
|
Revert part of column change
Use the start column of the comment on each line. Use the end column
only on the last line.
|
diff --git a/session.go b/session.go
index <HASH>..<HASH> 100644
--- a/session.go
+++ b/session.go
@@ -590,7 +590,9 @@ runLoop:
default:
}
}
- } else if !processedUndecryptablePacket {
+ }
+ // If we processed any undecryptable packets, jump to the resetting of the timers directly.
+ if !processedUndecryptablePacket {
select {
case closeErr = <-s.closeChan:
break runLoop
|
enter the regular run loop if no undecryptable packet was processed
|
diff --git a/lib/plucky/criteria_hash.rb b/lib/plucky/criteria_hash.rb
index <HASH>..<HASH> 100644
--- a/lib/plucky/criteria_hash.rb
+++ b/lib/plucky/criteria_hash.rb
@@ -72,7 +72,7 @@ module Plucky
end
def object_ids=(value)
- raise ArgumentError unless value.respond_to?(:flatten)
+ raise ArgumentError unless value.is_a?(Array)
@options[:object_ids] = value.flatten
end
diff --git a/test/plucky/test_criteria_hash.rb b/test/plucky/test_criteria_hash.rb
index <HASH>..<HASH> 100644
--- a/test/plucky/test_criteria_hash.rb
+++ b/test/plucky/test_criteria_hash.rb
@@ -37,7 +37,7 @@ class CriteriaHashTest < Test::Unit::TestCase
criteria.object_ids.should == [:_id]
end
- should "raise argument error if does not respond to flatten" do
+ should "raise argument error if not array" do
assert_raises(ArgumentError) { CriteriaHash.new.object_ids = {} }
assert_raises(ArgumentError) { CriteriaHash.new.object_ids = nil }
assert_raises(ArgumentError) { CriteriaHash.new.object_ids = 'foo' }
|
Ruby <I> fix. Hashes respond to flatten so just allowing arrays which should be fine.
|
diff --git a/src/clusterpost-provider/executionserver.handlers.js b/src/clusterpost-provider/executionserver.handlers.js
index <HASH>..<HASH> 100644
--- a/src/clusterpost-provider/executionserver.handlers.js
+++ b/src/clusterpost-provider/executionserver.handlers.js
@@ -14,6 +14,23 @@ module.exports = function (server, conf) {
var LinkedList = require('linkedlist');
var remotedeletequeue = new LinkedList();
+ const validate = function(req, decodedToken){
+ var exs = server.methods.executionserver.getExecutionServer(decodedToken.executionserver);
+ if(exs){
+ exs.scope = ['executionserver'];
+ return Promise.resolve(exs);
+ }else{
+ return Promise.reject(Boom.unauthorized(exs));
+ }
+ }
+
+ if(server.methods.jwtauth){
+ server.methods.jwtauth.addValidationFunction(validate);
+ }else{
+ throw "Please update hapi-jwt-couch to version >= 3.0.0";
+ }
+
+
const startExecutionServers = function(){
return Promise.map(_.keys(conf.executionservers), function(eskey){
return new Promise(function(resolve, reject){
|
ENH: Add validation function logic here
The package clusterpost-auth is deprecated now
The token validation for the execution server is performed here
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -85,7 +85,7 @@ setup(
# your project is installed. For an analysis of "install_requires" vs pip's
# requirements files see:
# https://packaging.python.org/en/latest/requirements.html
- install_requires=['requests', 'envparse', 'typing', 'jsonschema'],
+ install_requires=['requests', 'envparse', 'typing', 'six', 'jsonschema'],
setup_requires=['pytest-runner'],
tests_require=['pytest', 'pytz', 'betamax', 'six'],
|
adding six to the setup
see also #<I>
|
diff --git a/src/Administration/Resources/e2e/routes/cypress.js b/src/Administration/Resources/e2e/routes/cypress.js
index <HASH>..<HASH> 100644
--- a/src/Administration/Resources/e2e/routes/cypress.js
+++ b/src/Administration/Resources/e2e/routes/cypress.js
@@ -4,7 +4,7 @@ const childProcess = require('child_process');
const app = express();
app.get('/cleanup', (req, res) => {
- return childProcess.exec('./psh.phar e2e:cleanup', (err, stdin, stderr) => {
+ return childProcess.exec('./psh.phar e2e:cleanup', { maxBuffer: 2000 * 1024 }, (err, stdin, stderr) => {
if (err) {
console.log('stderr: ', stderr);
|
NTR - increase maxBuffer
|
diff --git a/chess/uci.py b/chess/uci.py
index <HASH>..<HASH> 100644
--- a/chess/uci.py
+++ b/chess/uci.py
@@ -901,7 +901,13 @@ class Engine(object):
future.add_done_callback(async_callback)
return future
else:
- return future.result()
+ # Avoid calling future.result() without a timeout. In Python 2
+ # such a call cannot be interrupted.
+ while not future.done():
+ try:
+ return future.result(timeout=60)
+ except concurrent.futures.TimeoutError:
+ pass
def uci(self, async_callback=None):
"""
|
Avoid calling future.result() without a timeout (#<I>)
|
diff --git a/head.go b/head.go
index <HASH>..<HASH> 100644
--- a/head.go
+++ b/head.go
@@ -1364,7 +1364,6 @@ type memSeries struct {
firstChunkID int
nextAt int64 // Timestamp at which to cut the next chunk.
- lastValue float64
sampleBuf [4]sample
pendingCommit bool // Whether there are samples waiting to be committed to this series.
@@ -1432,7 +1431,7 @@ func (s *memSeries) appendable(t int64, v float64) error {
}
// We are allowing exact duplicates as we can encounter them in valid cases
// like federation and erroring out at that time would be extremely noisy.
- if math.Float64bits(s.lastValue) != math.Float64bits(v) {
+ if math.Float64bits(s.sampleBuf[3].v) != math.Float64bits(v) {
return ErrAmendSample
}
return nil
@@ -1504,8 +1503,6 @@ func (s *memSeries) append(t int64, v float64) (success, chunkCreated bool) {
c.maxTime = t
- s.lastValue = v
-
s.sampleBuf[0] = s.sampleBuf[1]
s.sampleBuf[1] = s.sampleBuf[2]
s.sampleBuf[2] = s.sampleBuf[3]
|
Use sampleBuf instead of maintaining lastValue. (#<I>)
This cuts the size of memSize by 8B.
|
diff --git a/ceph_deploy/tests/unit/hosts/test_suse.py b/ceph_deploy/tests/unit/hosts/test_suse.py
index <HASH>..<HASH> 100644
--- a/ceph_deploy/tests/unit/hosts/test_suse.py
+++ b/ceph_deploy/tests/unit/hosts/test_suse.py
@@ -19,7 +19,7 @@ class TestSuseInit(object):
init_type = self.host.choose_init()
assert ( init_type == "systemd")
- def test_choose_init_openSUSE_13.1(self):
+ def test_choose_init_openSUSE_13_1(self):
self.host.release = '13.1'
init_type = self.host.choose_init()
assert ( init_type == "systemd")
|
functionnames cant have '.' in the name
|
diff --git a/Trustly/Data/jsonrpcresponse.php b/Trustly/Data/jsonrpcresponse.php
index <HASH>..<HASH> 100644
--- a/Trustly/Data/jsonrpcresponse.php
+++ b/Trustly/Data/jsonrpcresponse.php
@@ -33,15 +33,15 @@ class Trustly_Data_JSONRPCResponse extends Trustly_Data_Response {
}
public function getErrorCode() {
- if($this->isError() && isset($this->result['data']['code'])) {
- return $this->result['data']['code'];
+ if($this->isError() && isset($this->result['error']['code'])) {
+ return $this->result['error']['code'];
}
return NULL;
}
public function getErrorMessage() {
- if($this->isError() && isset($this->result['data']['message'])) {
- return $this->result['data']['message'];
+ if($this->isError() && isset($this->result['error']['message'])) {
+ return $this->result['error']['message'];
}
return NULL;
}
|
Collect the error in the correct location
|
diff --git a/lib/functions/image.js b/lib/functions/image.js
index <HASH>..<HASH> 100644
--- a/lib/functions/image.js
+++ b/lib/functions/image.js
@@ -62,16 +62,18 @@ Image.prototype.close = function(){
Image.prototype.type = function(){
var type
- , chunk = fs.readSync(this.fd, 10, 0)[0];
+ , buf = new Buffer(4);
+
+ fs.readSync(this.fd, buf, 0, 4, 0);
// GIF
- if ('GIF' == chunk.slice(0, 3)) type = 'gif';
+ if (0x47 == buf[0] && 0x49 == buf[1] && 0x46 == buf[2]) type = 'gif';
// PNG
- if ('PNG' == chunk.slice(1, 4)) type = 'png';
+ else if (0x50 == buf[1] && 0x4E == buf[2] && 0x47 == buf[3]) type = 'png';
// JPEG
- if ('JFIF' == chunk.slice(6, 10)) type = 'jpeg';
+ else if (0xff == buf[0] && 0xd8 == buf[1]) type = 'jpeg';
return type;
};
|
Refactored Image#type()
|
diff --git a/lib/compiler.js b/lib/compiler.js
index <HASH>..<HASH> 100644
--- a/lib/compiler.js
+++ b/lib/compiler.js
@@ -1,6 +1,5 @@
'use strict';
-var fs = require('fs');
var utils = require('./utils');
/**
|
Compiler no longer uses fs, removing require
|
diff --git a/Tests/Functional/FunctionalTest.php b/Tests/Functional/FunctionalTest.php
index <HASH>..<HASH> 100644
--- a/Tests/Functional/FunctionalTest.php
+++ b/Tests/Functional/FunctionalTest.php
@@ -223,7 +223,7 @@ class FunctionalTest extends WebTestCase
'dateAsInterface' => [
'type' => 'string',
'format' => 'date-time',
- ]
+ ],
],
],
$this->getModel('User')->toArray()
|
Add ',' in the end of array
|
diff --git a/tests/scripts/install_odoo.py b/tests/scripts/install_odoo.py
index <HASH>..<HASH> 100755
--- a/tests/scripts/install_odoo.py
+++ b/tests/scripts/install_odoo.py
@@ -50,6 +50,8 @@ def install_odoo():
subprocess.check_call(["pip", "install", "pyyaml<4"])
# Odoo not compatible with werkzeug 1.0: https://github.com/odoo/odoo/issues/45914
subprocess.check_call(["pip", "install", "werkzeug<1"])
+ # Odoo not compatible with Jinja2 >= 2.11
+ subprocess.check_call(["pip", "install", "jinja2<2.11"])
subprocess.check_call(["pip", "install", "-e", odoo_dir])
|
Workaround Odoo jinja2 compatibility issue
|
diff --git a/lib/model/precondition.rb b/lib/model/precondition.rb
index <HASH>..<HASH> 100644
--- a/lib/model/precondition.rb
+++ b/lib/model/precondition.rb
@@ -43,7 +43,7 @@ module SimpleXml
handle_temporal
elsif attr_val('@type') == DATETIMEDIFF
handle_grouping_functional
- elsif attr_val('@type') == SATISFIES_ALL || attr_val('@type') == SATISFIES_ANY
+ elsif (attr_val('@type') == SATISFIES_ALL || attr_val('@type') == SATISFIES_ANY) && @subset.nil?
handle_satisfies
elsif @entry.name == DATA_CRITERIA_OP || @subset
handle_data_criteria
|
Correctly handle SATISFIES clauses within subset operators
|
diff --git a/Kwc/Form/Component.defer.js b/Kwc/Form/Component.defer.js
index <HASH>..<HASH> 100644
--- a/Kwc/Form/Component.defer.js
+++ b/Kwc/Form/Component.defer.js
@@ -52,6 +52,8 @@ Kwc.Form.Component = function(form)
}
}, this);
+ this.errorStyle = new Kwf.FrontendForm.errorStyles[this.config.errorStyle](this);
+
this.fields.forEach(function(f) {
f.initField();
});
@@ -84,8 +86,6 @@ Kwc.Form.Component = function(form)
this.fireEvent('fieldChange', f);
}, this);
}, this);
-
- this.errorStyle = new Kwf.FrontendForm.errorStyles[this.config.errorStyle](this);
};
Ext2.extend(Kwc.Form.Component, Ext2.util.Observable, {
getFieldConfig: function(fieldName)
|
moved code for errorStyle before form fields init in frontendForm
|
diff --git a/drivers/virtualbox/virtualbox.go b/drivers/virtualbox/virtualbox.go
index <HASH>..<HASH> 100644
--- a/drivers/virtualbox/virtualbox.go
+++ b/drivers/virtualbox/virtualbox.go
@@ -656,9 +656,7 @@ func getAvailableTCPPort(port int) (int, error) {
port = 0 // Throw away the port hint before trying again
time.Sleep(1)
}
- time.Sleep(1)
return 0, fmt.Errorf("unable to allocate tcp port")
-
}
// Setup a NAT port forwarding entry.
|
Remove stray sleep()
This is just a bit of development debris.
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -70,7 +70,7 @@ http://<thumbor-server>/300x200/smart/s.glbimg.com/et/bb/f/original/2011/03/24/V
install_requires=[
"tornado>=2.1.1,<2.2.0",
- "pyCrypto>=2.4.1,<2.5.0",
+ "pyCrypto>=2.4.1",
"pycurl>=7.19.0,<7.20.0",
"Pillow>=1.7.5,<1.8.0",
"derpconf>=0.2.0",
|
as ubuntu <I> comes with python-crypto <I>-2, Thumbor does not want starting
|
diff --git a/djangui/backend/ast/source_parser.py b/djangui/backend/ast/source_parser.py
index <HASH>..<HASH> 100644
--- a/djangui/backend/ast/source_parser.py
+++ b/djangui/backend/ast/source_parser.py
@@ -123,9 +123,9 @@ def walk_tree(node):
for key, value in d.items():
if isinstance(value, list):
for val in value:
- for _ in walk_tree(val):
+ for _ in ast.walk(val):
yield _
- elif 'ast' in str(type(value)):
+ elif issubclass(type(value), ast.AST):
for _ in walk_tree(value):
yield _
else:
|
fix for argparse being defined inside the __main__ statement
|
diff --git a/spec/lib/bootstrap_forms/form_builder_spec.rb b/spec/lib/bootstrap_forms/form_builder_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/bootstrap_forms/form_builder_spec.rb
+++ b/spec/lib/bootstrap_forms/form_builder_spec.rb
@@ -97,7 +97,7 @@ describe 'BootstrapForms::FormBuilder' do
end
it "does not add the required attribute if required: false" do
- @builder.text_field('owner', required: false).should_not match /<input .*required="required"/
+ @builder.text_field('owner', :required => false).should_not match /<input .*required="required"/
end
it "not require if or unless validators" do
|
use hashrockets for < Ruby <I>
|
diff --git a/src/service.js b/src/service.js
index <HASH>..<HASH> 100644
--- a/src/service.js
+++ b/src/service.js
@@ -139,9 +139,9 @@ class Service {
if (this.id === '_id') {
// We can not update default mongo ids
delete data[this.id];
- } else if (data[this.id] === undefined) {
- // If not using the default Mongo _id field and you haven't passed a new id field
- // then set the id to its previous value. This prevents orphaned documents.
+ } else {
+ // If not using the default Mongo _id field set the id to its
+ // previous value. This prevents orphaned documents.
data[this.id] = id;
}
@@ -172,9 +172,9 @@ class Service {
if (this.id === '_id') {
// We can not update default mongo ids
delete data[this.id];
- } else if (data[this.id] === undefined) {
- // If not using the default Mongo _id field and you haven't passed a new id field
- // then set the id to its previous value. This prevents orphaned documents.
+ } else {
+ // If not using the default Mongo _id field set the id to its
+ // previous value. This prevents orphaned documents.
data[this.id] = id;
}
|
enforcing that you shouldn't be able to change ids
|
diff --git a/nrrd.py b/nrrd.py
index <HASH>..<HASH> 100644
--- a/nrrd.py
+++ b/nrrd.py
@@ -288,11 +288,12 @@ def read_header(nrrdfile):
it = iter(nrrdfile)
- headerSize += _validate_magic_line(it.next())
+ headerSize += _validate_magic_line(next(it).decode('ascii'))
header = { 'keyvaluepairs': {} }
for raw_line in it:
headerSize += len(raw_line)
+ raw_line = raw_line.decode('ascii')
# Trailing whitespace ignored per the NRRD spec
line = raw_line.rstrip()
|
Python 3 compatibility
- Decode header as ASCII to work with Python 3 (as is assumed in NRRD format, <URL>)
- next(it) instead of it.next()
Changes work for Python 2 & 3
|
diff --git a/code/Helpers/ConfigParser.php b/code/Helpers/ConfigParser.php
index <HASH>..<HASH> 100644
--- a/code/Helpers/ConfigParser.php
+++ b/code/Helpers/ConfigParser.php
@@ -201,7 +201,10 @@ class ConfigParser
$arguments = isset($matches[2]) ? $matches[2] : '';
foreach ($this->config->providers as $provider) {
- if (isset($provider::$shorthand)) {
+ if (!class_exists($provider)) {
+ // todo log somewhere else? this would log every time parser options are checked
+ SS_Log::log("provider class '{$provider}' cannot be found");
+ } else if (isset($provider::$shorthand)) {
if (strtolower($provider::$shorthand) === $shorthand) {
$options = $provider::parseOptions($arguments);
$options['provider'] = $provider;
|
BUGFIX: check for provider class exists
|
diff --git a/craftai/client.py b/craftai/client.py
index <HASH>..<HASH> 100644
--- a/craftai/client.py
+++ b/craftai/client.py
@@ -32,7 +32,7 @@ class CraftAIClient(object):
""" or invalid token provided.""")
if (not isinstance(cfg.get("project"), six.string_types)):
raise CraftAICredentialsError("""Unable to create client with no"""
- """ or invalid owner provided.""")
+ """ or invalid project provided.""")
else:
splittedProject = cfg.get("project").split('/')
if (len(splittedProject) == 2):
|
Fix the error message when the project is badly set
|
diff --git a/lib/plugins/processor/index.js b/lib/plugins/processor/index.js
index <HASH>..<HASH> 100644
--- a/lib/plugins/processor/index.js
+++ b/lib/plugins/processor/index.js
@@ -315,7 +315,8 @@ extend.processor.register(/^([^_].*)\.(\w+)/, function(file, callback){
if (renderer.indexOf(extname) === -1){
route.set(path, function(fn){
- fn(null, content);
+ var rs = fs.createReadStream(source);
+ fn(null, rs);
});
callback();
} else {
|
Processor: Write source file with stream
|
diff --git a/src/test/java/org/reflections/ReflectionsTest.java b/src/test/java/org/reflections/ReflectionsTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/reflections/ReflectionsTest.java
+++ b/src/test/java/org/reflections/ReflectionsTest.java
@@ -214,7 +214,7 @@ public class ReflectionsTest {
@Test
public void testResourcesScanner() {
- Predicate<String> filter = new FilterBuilder().include(".*\\.xml");
+ Predicate<String> filter = new FilterBuilder().include(".*\\.xml").exclude(".*testModel-reflections\\.xml");
Reflections reflections = new Reflections(new ConfigurationBuilder()
.filterInputsBy(filter)
.setScanners(new ResourcesScanner())
@@ -224,8 +224,7 @@ public class ReflectionsTest {
assertThat(resolved, are("META-INF/reflections/resource1-reflections.xml"));
Set<String> resources = reflections.getStore().get(ResourcesScanner.class.getSimpleName()).keySet();
- assertThat(resources, are("resource1-reflections.xml", "resource2-reflections.xml",
- "testModel-reflections.xml"));
+ assertThat(resources, are("resource1-reflections.xml", "resource2-reflections.xml"));
}
@Test
|
Fix inconsistency in unit tests related to testModel-reflections.xml
The META-INF/reflections/testModel-reflections.xml file is created by
ReflectionsCollectTest, and its presence was expected in
ReflectionsTest.testResourcesScanner(). The assertion wasn't always
satisfied, depending on the order of execution of tests.
Make testResourcesScanner() exclude testModel-reflections.xml from
scanned resources and change the assertion not to expect the excluded
file.
|
diff --git a/src/FeedIo/FeedIo.php b/src/FeedIo/FeedIo.php
index <HASH>..<HASH> 100644
--- a/src/FeedIo/FeedIo.php
+++ b/src/FeedIo/FeedIo.php
@@ -45,9 +45,8 @@ class FeedIo
public function __construct(ClientInterface $client, LoggerInterface $logger)
{
$this->logger = $logger;
- $this->reader = new Reader($client, $logger);
$this->dateTimeBuilder = new DateTimeBuilder;
-
+ $this->setReader(new Reader($client, $logger));
$this->loadCommonStandards();
}
@@ -74,7 +73,7 @@ class FeedIo
'rss' => new Rss($this->dateTimeBuilder),
);
}
-
+
/**
* @param string $name
* @param \FeedIo\StandardAbstract $standard
@@ -92,6 +91,33 @@ class FeedIo
}
/**
+ * @return \FeedIo\Rule\DateTimeBuilder
+ */
+ public function getDateTimeBuilder()
+ {
+ return $this->dateTimeBuilder;
+ }
+
+ /**
+ * @return \FeedIo\Reader
+ */
+ public function getReader()
+ {
+ return $this->reader;
+ }
+
+ /**
+ * @param \FeedIo\Reader
+ * @return $this
+ */
+ public function setReader(Reader $reader)
+ {
+ $this->reader = $reader;
+
+ return $this:
+ }
+
+ /**
* @param $url
* @param FeedInterface $feed
* @param \DateTime $modifiedSince
|
getter and setter for the reader attribute
|
diff --git a/test/TestCases.template.js b/test/TestCases.template.js
index <HASH>..<HASH> 100644
--- a/test/TestCases.template.js
+++ b/test/TestCases.template.js
@@ -199,7 +199,7 @@ const describeCases = config => {
return;
function _it(title, fn) {
- exportedTests.push({ title, fn, timeout: 5000 });
+ exportedTests.push({ title, fn, timeout: 10000 });
}
function _require(module) {
|
increase timeout for TestCases to <I>s
|
diff --git a/src/java/org/archive/wayback/http11resourcestore/Http11ResourceStore.java b/src/java/org/archive/wayback/http11resourcestore/Http11ResourceStore.java
index <HASH>..<HASH> 100644
--- a/src/java/org/archive/wayback/http11resourcestore/Http11ResourceStore.java
+++ b/src/java/org/archive/wayback/http11resourcestore/Http11ResourceStore.java
@@ -104,9 +104,15 @@ public class Http11ResourceStore implements ResourceStore {
// for now, we'll just grab the first one:
String arcUrl = arcUrls[0];
- ARCReader ar = ARCReaderFactory.get(new URL(arcUrl),offset);
- ARCRecord rec = ar.get();
- Resource r = new Resource(rec,ar);
+ Resource r = null;
+ try {
+ ARCReader ar = ARCReaderFactory.get(new URL(arcUrl),offset);
+ ARCRecord rec = ar.get();
+ r = new Resource(rec,ar);
+ } catch (IOException e) {
+ throw new ResourceNotAvailableException("Unable to retrieve",
+ e.getLocalizedMessage());
+ }
return r;
|
BUGFIX: IOExceptions including HTTP errors, no route to host, etc were not being handled and wrapped as ResourceNotAvailable exceptions.
git-svn-id: <URL>
|
diff --git a/src/Core/Builder/Request/ShippingMethodRequestBuilder.php b/src/Core/Builder/Request/ShippingMethodRequestBuilder.php
index <HASH>..<HASH> 100644
--- a/src/Core/Builder/Request/ShippingMethodRequestBuilder.php
+++ b/src/Core/Builder/Request/ShippingMethodRequestBuilder.php
@@ -98,7 +98,7 @@ class ShippingMethodRequestBuilder
*/
public function getMatchingOrderEdit($orderEditId, Location $location)
{
- $request = ShippingMethodByMatchingOrderEditGetRequest::ofOrderEditAndCountry($orderEditId, $location->getCountry());
+ $request = ShippingMethodByMatchingOrderEditGetRequest::ofOrderEditAndCountry($orderEditId, $location);
return $request;
}
|
WIP: add requestbuilder not added by the git add
|
diff --git a/pymongo/collection.py b/pymongo/collection.py
index <HASH>..<HASH> 100644
--- a/pymongo/collection.py
+++ b/pymongo/collection.py
@@ -1007,7 +1007,8 @@ class Collection(common.BaseObject):
response = self.__database.command("mapreduce", self.__name,
map=map, reduce=reduce,
out=out_conf, **kwargs)
- if full_response:
+
+ if full_response or not response.get('result'):
return response
elif isinstance(response['result'], dict):
dbase = response['result']['db']
|
Handle no 'result' field in M/R PYTHON-<I>
For now this only happens with inline map reduce which
we provide a separate method to handle.
|
diff --git a/pyani/pyani_graphics.py b/pyani/pyani_graphics.py
index <HASH>..<HASH> 100644
--- a/pyani/pyani_graphics.py
+++ b/pyani/pyani_graphics.py
@@ -207,7 +207,7 @@ def heatmap_mpl(df, outfilename=None, title=None, cmap=None,
width_ratios = [1, 0.15])
rowdend_axes = fig.add_subplot(rowGS[0, 0])
rowdend = sch.dendrogram(rowclusters, color_threshold=np.inf,
- orientation="left")
+ orientation="right")
clean_axis(rowdend_axes)
# Create heatmap axis
|
Corrected row dendrogram orientation in MPL
|
diff --git a/machina/apps/conversation/views.py b/machina/apps/conversation/views.py
index <HASH>..<HASH> 100644
--- a/machina/apps/conversation/views.py
+++ b/machina/apps/conversation/views.py
@@ -73,7 +73,7 @@ class TopicView(PermissionRequiredMixin, ListView):
def get_queryset(self):
self.topic = self.get_topic()
- qs = self.topic.posts.all().exclude(approved=False)
+ qs = self.topic.posts.all().exclude(approved=False).prefetch_related('attachments')
return qs
def get_controlled_object(self):
@@ -145,6 +145,7 @@ class PostEditMixin(object):
def form_valid(self, form):
preview = 'preview' in self.request.POST
+ save_attachment_formset = False
if perm_handler.can_attach_files(self.get_forum(), self.request.user):
attachment_formset = self.attachment_formset_class(
|
Fixed PostEdit mixin form_valid method
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.