hash
stringlengths 40
40
| diff
stringlengths 131
114k
| message
stringlengths 7
980
| project
stringlengths 5
67
| split
stringclasses 1
value |
|---|---|---|---|---|
c7b5be6466a41c60f4318613b7467355eba77524
|
diff --git a/ohapi/api.py b/ohapi/api.py
index <HASH>..<HASH> 100644
--- a/ohapi/api.py
+++ b/ohapi/api.py
@@ -195,7 +195,7 @@ def upload_file(target_filepath, metadata, access_token, base_url=OH_BASE_URL,
return r
-def delete_file(access_token, project_member_id, base_url=OH_BASE_URL,
+def delete_file(access_token, project_member_id=None, base_url=OH_BASE_URL,
file_basename=None, file_id=None, all_files=False):
"""
Delete project member files by file_basename, file_id, or all_files. To
@@ -203,7 +203,8 @@ def delete_file(access_token, project_member_id, base_url=OH_BASE_URL,
https://www.openhumans.org/direct-sharing/oauth2-features/.
:param access_token: This field is user specific access_token.
- :param project_member_id: This field is the project member id of user.
+ :param project_member_id: This field is the project member id of user. It's
+ default value is None.
:param base_url: It is this URL `https://www.openhumans.org`.
:param file_basename: This field is the name of the file to delete for the
particular user for the particular project.
@@ -215,6 +216,9 @@ def delete_file(access_token, project_member_id, base_url=OH_BASE_URL,
url = urlparse.urljoin(
base_url, '/api/direct-sharing/project/files/delete/?{}'.format(
urlparse.urlencode({'access_token': access_token})))
+ if not(project_member_id):
+ response = exchange_oauth2_member(access_token)
+ project_member_id = response['project_member_id']
data = {'project_member_id': project_member_id}
if file_basename and not (file_id or all_files):
data['file_basename'] = file_basename
|
Made project member id not required for delete_file (#<I>)
* project_member_id optional in upload function
* resolving code climate issue
* project_member_id optional in upload function
* fix hound errors
* Update api.py
* optional project_member_id
* Hound fixes and other refactoring
* Hound fixes
* Hound fixes
* Hound fixes
* Hound fixes
* added tests for get_page
* hound fix
* project member id default to none
|
OpenHumans_open-humans-api
|
train
|
521399affcc6dc89e7d8e4e20ef47433d7d0fa36
|
diff --git a/bcbio/cwl/tool.py b/bcbio/cwl/tool.py
index <HASH>..<HASH> 100644
--- a/bcbio/cwl/tool.py
+++ b/bcbio/cwl/tool.py
@@ -69,6 +69,7 @@ def _run_toil(args):
"""
main_file, json_file = _get_main_and_json(args.directory)
work_dir = utils.safe_makedir(os.path.join(os.getcwd(), "cwltoil_work"))
+ os.environ["TMPDIR"] = work_dir
log_file = os.path.join(work_dir, "cwltoil.log")
jobstore = os.path.join(work_dir, "cwltoil_jobstore")
flags = ["--jobStore", jobstore, "--logFile", log_file, "--workDir", work_dir]
|
CWL: Toil SLURM/SGE support; stage in shared dirs
Ensures Toil CWL runs stage files in a local shared directory instead
of local `/tmp` allowing them to be accessed across the cluster.
|
bcbio_bcbio-nextgen
|
train
|
04500f9df95b5e518afb914108e2f1310b1919ae
|
diff --git a/acos_client/v30/vrrpa/vrid.py b/acos_client/v30/vrrpa/vrid.py
index <HASH>..<HASH> 100644
--- a/acos_client/v30/vrrpa/vrid.py
+++ b/acos_client/v30/vrrpa/vrid.py
@@ -12,6 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
+from acos_client import errors as acos_errors
from acos_client.v30 import base
from acos_client.v30.vrrpa.blade_params import BladeParameters
@@ -30,6 +31,13 @@ class VRID(base.BaseV30):
def get(self, vrid_val):
return self._get(self.base_url + str(vrid_val))
+ def exists(self, vrid_val):
+ try:
+ self.get(vrid_val)
+ return True
+ except acos_errors.NotFound:
+ return False
+
def _build_params(self, vrid_val, threshold=None, disable=None):
vrid = {'vrid-val': vrid_val}
|
Added exists() method for extra functionality.
|
a10networks_acos-client
|
train
|
f06725e153e1ed3392de55fbbf8e13363de3c904
|
diff --git a/src/Application.php b/src/Application.php
index <HASH>..<HASH> 100644
--- a/src/Application.php
+++ b/src/Application.php
@@ -88,12 +88,6 @@ class Application extends Container
$this['config'] = $config;
$this['environment'] = $environment;
- /* Error Reporting */
-
- ini_set('display_errors', $environment !== self::ENV_PRODUCTION);
- ini_set('log_errors', 1);
- error_reporting(E_ALL | E_STRICT);
-
/* Base URL */
$this['base_url'] = function () use ($config) {
diff --git a/src/Test.php b/src/Test.php
index <HASH>..<HASH> 100644
--- a/src/Test.php
+++ b/src/Test.php
@@ -25,6 +25,11 @@ class Test implements PHPUnit_Framework_TestListener
public function __construct()
{
+ // display all errors, log none
+ ini_set('display_errors', 1);
+ ini_set('log_errors', 0);
+ error_reporting(E_ALL | E_STRICT);
+
$config = [];
if (file_exists('config.php')) {
$config = include 'config.php';
|
remove error handling ini settings from main application - leave that up to deployment + always display errors without logging when testing
|
infusephp_infuse
|
train
|
ce941563a5034c6d9b37e9136e0c26e073f371fb
|
diff --git a/src/__tests__/__snapshots__/babel.test.js.snap b/src/__tests__/__snapshots__/babel.test.js.snap
index <HASH>..<HASH> 100644
--- a/src/__tests__/__snapshots__/babel.test.js.snap
+++ b/src/__tests__/__snapshots__/babel.test.js.snap
@@ -138,6 +138,25 @@ CSS MAPPINGS:[{\\"generated\\":{\\"line\\":1,\\"column\\":0},\\"original\\":{\\"
*/"
`;
+exports[`uses the same custom property for the same expression 1`] = `
+"const Box = styled.component('div', {
+ name: \\"Box\\",
+ class: \\"Box_b1ugh8t9\\",
+ vars: {
+ \\"b1ugh8t9-0-0\\": props => props.size
+ }
+});
+
+/*
+CSS OUTPUT START
+.Box_b1ugh8t9{height:var(--b1ugh8t9-0-0)px;width:var(--b1ugh8t9-0-0)px;}
+
+CSS OUTPUT END
+
+CSS MAPPINGS:[{\\"generated\\":{\\"line\\":1,\\"column\\":0},\\"original\\":{\\"line\\":1,\\"column\\":6},\\"name\\":\\"Box_b1ugh8t9\\"}]
+*/"
+`;
+
exports[`uses the same custom property for the same identifier 1`] = `
"const Box = styled.component('div', {
name: \\"Box\\",
diff --git a/src/__tests__/babel.test.js b/src/__tests__/babel.test.js
index <HASH>..<HASH> 100644
--- a/src/__tests__/babel.test.js
+++ b/src/__tests__/babel.test.js
@@ -65,6 +65,19 @@ it('uses the same custom property for the same identifier', async () => {
expect(code).toMatchSnapshot();
});
+it('uses the same custom property for the same expression', async () => {
+ const code = await transpile(
+ dedent`
+ const Box = styled('div')\`
+ height: ${'${props => props.size}'}px;
+ width: ${'${props => props.size}'}px;
+ \`;
+ `
+ );
+
+ expect(code).toMatchSnapshot();
+});
+
it('handles nested blocks', async () => {
const code = await transpile(
dedent`
diff --git a/src/babel/extract.js b/src/babel/extract.js
index <HASH>..<HASH> 100644
--- a/src/babel/extract.js
+++ b/src/babel/extract.js
@@ -155,23 +155,15 @@ module.exports = function(
}
}
- let id;
+ const source = ex.getSource();
- // If multiple expression refer to the same identifier, use a single id
- if (t.isIdentifier(ex.node)) {
- id = Object.keys(interpolations).find(key => {
- const node = interpolations[key];
-
- if (t.isIdentifier(node) && ex.node.name === node.name) {
- return true;
- }
-
- return false;
- });
- }
+ // If interpolations have the same expression, use a single id
+ let id = Object.keys(interpolations).find(
+ key => source === interpolations[key].getSource()
+ );
id = id || `${slug}-${state.index}-${i}`;
- interpolations[id] = ex.node;
+ interpolations[id] = ex;
cssText += `var(--${id})`;
}
}
@@ -194,7 +186,7 @@ module.exports = function(
t.identifier('vars'),
t.objectExpression(
Object.keys(interpolations).map(p =>
- t.objectProperty(t.stringLiteral(p), interpolations[p])
+ t.objectProperty(t.stringLiteral(p), interpolations[p].node)
)
)
)
|
fix: use the same custom property for the same expression
|
callstack_linaria
|
train
|
0c61bd961d0f0f4592a26de7f038db1fca085ac1
|
diff --git a/pulsar/client/transport/curl.py b/pulsar/client/transport/curl.py
index <HASH>..<HASH> 100644
--- a/pulsar/client/transport/curl.py
+++ b/pulsar/client/transport/curl.py
@@ -66,10 +66,18 @@ def post_file(url, path):
def get_file(url, path):
+ if path and os.path.exists(path):
+ buf = _open_output(path, 'ab')
+ size = os.path.getsize(path)
+ else:
+ buf = _open_output(path)
+ size = 0
buf = _open_output(path)
try:
c = _new_curl_object_for_url(url)
c.setopt(c.WRITEFUNCTION, buf.write)
+ if size > 0:
+ c.setopt(c.RESUME_FROM, size)
c.perform()
status_code = c.getinfo(HTTP_CODE)
if int(status_code) != 200:
@@ -79,8 +87,8 @@ def get_file(url, path):
buf.close()
-def _open_output(output_path):
- return open(output_path, 'wb') if output_path else BytesIO()
+def _open_output(output_path, mode='wb'):
+ return open(output_path, mode) if output_path else BytesIO()
def _new_curl_object_for_url(url):
|
Enable resumption of file stage-in when using curl.
|
galaxyproject_pulsar
|
train
|
34345affbae8530478d90e654c4a00e2e1f2a8d6
|
diff --git a/pyes/es.py b/pyes/es.py
index <HASH>..<HASH> 100644
--- a/pyes/es.py
+++ b/pyes/es.py
@@ -368,7 +368,8 @@ class ES(object):
If `indices` is not supplied, returns the default_indices.
"""
- indices = indices or self.default_indices
+ if indices is None:
+ return self.default_indices
if isinstance(indices, basestring):
indices = [indices]
return indices
@@ -384,6 +385,17 @@ class ES(object):
curl_cmd += " -d '%s'" % request.body
print >> self.dump_curl, curl_cmd
+ def _get_default_indices(self):
+ return self._default_indices
+
+ def _set_default_indices(self, default_indices):
+ if default_indices is not None:
+ default_indices = self._validate_indices(default_indices)
+ self._default_indices = default_indices
+
+ default_indices = property(_get_default_indices, _set_default_indices)
+ del _get_default_indices, _set_default_indices
+
#---- Admin commands
def status(self, indices=None):
"""
|
Changed ES.default_indices to a property that calls _validate_indices() on set
|
aparo_pyes
|
train
|
41aa158998e54295ef2a91b544241f185dc2f6b5
|
diff --git a/sitebricks-mail/src/main/java/com/google/sitebricks/mail/CommandCompletion.java b/sitebricks-mail/src/main/java/com/google/sitebricks/mail/CommandCompletion.java
index <HASH>..<HASH> 100644
--- a/sitebricks-mail/src/main/java/com/google/sitebricks/mail/CommandCompletion.java
+++ b/sitebricks-mail/src/main/java/com/google/sitebricks/mail/CommandCompletion.java
@@ -44,7 +44,7 @@ class CommandCompletion {
new Object[] { commandString, sequence, message, builder.toString(), e });
// TODO Send this back to the client as an exception so it can be handled correctly.
-// valueFuture.setException(new MailHandlingException(value, message, e));
+ valueFuture.setException(new MailHandlingException(value, message, e));
}
public boolean complete(String message) {
diff --git a/sitebricks-mail/src/main/java/com/google/sitebricks/mail/MailClientHandler.java b/sitebricks-mail/src/main/java/com/google/sitebricks/mail/MailClientHandler.java
index <HASH>..<HASH> 100644
--- a/sitebricks-mail/src/main/java/com/google/sitebricks/mail/MailClientHandler.java
+++ b/sitebricks-mail/src/main/java/com/google/sitebricks/mail/MailClientHandler.java
@@ -270,7 +270,7 @@ class MailClientHandler extends SimpleChannelHandler {
private synchronized void complete(String message) {
// This is a weird problem with writing stuff while idling. Need to investigate it more, but
// for now just ignore it.
- if (MESSAGE_COULDNT_BE_FETCHED_REGEX.matcher(message).matches()) {
+ if (MESSAGE_COULDNT_BE_FETCHED_REGEX.matcher(message).matches()) {
log.warn("Some messages in the batch could not be fetched for {}\n" +
"---cmd---\n{}\n---wire---\n{}\n---end---\n", new Object[] {
config.getUsername(),
@@ -278,7 +278,15 @@ class MailClientHandler extends SimpleChannelHandler {
getWireTrace()
});
errorStack.push(new Error(completions.peek(), message, wireTrace.list()));
- throw new RuntimeException("Some messages in the batch could not be fetched for user " + config.getUsername());
+ final CommandCompletion completion = completions.peek();
+ String errorMsg = "Some messages in the batch could not be fetched for user " + config.getUsername();
+ RuntimeException ex = new RuntimeException(errorMsg);
+ if (completion != null) {
+ completion.error(errorMsg, new MailHandlingException(getWireTrace(), errorMsg, ex));
+ completions.poll();
+ } else {
+ throw ex;
+ }
}
CommandCompletion completion = completions.peek();
diff --git a/sitebricks-mail/src/main/java/com/google/sitebricks/mail/NettyImapClient.java b/sitebricks-mail/src/main/java/com/google/sitebricks/mail/NettyImapClient.java
index <HASH>..<HASH> 100644
--- a/sitebricks-mail/src/main/java/com/google/sitebricks/mail/NettyImapClient.java
+++ b/sitebricks-mail/src/main/java/com/google/sitebricks/mail/NettyImapClient.java
@@ -221,6 +221,8 @@ public class NettyImapClient implements MailClient, Idler {
}
currentFolder = null;
+ } catch (Exception e) {
+ // swallow any exceptions.
} finally {
// Shut down all channels and exit (leave threadpools as is--for reconnects).
// The Netty channel close listener will fire a disconnect event to our client,
|
set exception on unsuccessful command completion and return error when processing an IMAP response with NO some messages in batch could not be processed.
|
dhanji_sitebricks
|
train
|
5a566b3363ecab563ed503212d209b649c76afef
|
diff --git a/git/packet_writer.go b/git/packet_writer.go
index <HASH>..<HASH> 100644
--- a/git/packet_writer.go
+++ b/git/packet_writer.go
@@ -37,9 +37,9 @@ func NewPacketWriter(w io.Writer) *PacketWriter {
// underlying stream of data, and the process repeats.
//
// When the caller has no more data to write in the given chunk of packets, a
-// subsequent call to `Write(p []byte)` MUST be made with an empty slice, to
-// flush the remaining data in the buffer, and write the terminating bytes to
-// the underlying packet stream.
+// subsequent call to `Write(p []byte)` MUST be made with a nil slice, to flush
+// the remaining data in the buffer, and write the terminating bytes to the
+// underlying packet stream.
//
// Write returns the number of bytes in "p" actually written to the underlying
// protocol stream, not including the number of bytes written in those packets
@@ -49,7 +49,7 @@ func NewPacketWriter(w io.Writer) *PacketWriter {
func (w *PacketWriter) Write(p []byte) (int, error) {
var n int
- if len(p) == 0 {
+ if p == nil {
// If we got an empty sequence of bytes, let's flush the data
// stored in the buffer, and then write the a packet termination
// sequence.
diff --git a/git/packet_writer_test.go b/git/packet_writer_test.go
index <HASH>..<HASH> 100644
--- a/git/packet_writer_test.go
+++ b/git/packet_writer_test.go
@@ -13,7 +13,7 @@ func TestPacketWriterWritesPacketsShorterThanMaxPacketSize(t *testing.T) {
w := NewPacketWriter(&buf)
assertWriterWrite(t, w, []byte("Hello, world!"), 0)
- assertWriterWrite(t, w, []byte{}, len("Hello, world!"))
+ assertWriterWrite(t, w, nil, len("Hello, world!"))
proto := newProtocolRW(&buf, nil)
assertPacketRead(t, proto, []byte("Hello, world!"))
@@ -34,7 +34,7 @@ func TestPacketWriterWritesPacketsEqualToMaxPacketLength(t *testing.T) {
w := NewPacketWriter(&buf)
assertWriterWrite(t, w, p, len(big))
- assertWriterWrite(t, w, []byte{}, 0)
+ assertWriterWrite(t, w, nil, 0)
proto := newProtocolRW(&buf, nil)
assertPacketRead(t, proto, big)
@@ -47,7 +47,7 @@ func TestPacketWriterWritesMultiplePacketsLessThanMaxPacketLength(t *testing.T)
w := NewPacketWriter(&buf)
assertWriterWrite(t, w, []byte("first\n"), 0)
assertWriterWrite(t, w, []byte("second"), 0)
- assertWriterWrite(t, w, []byte{}, len("first\nsecond"))
+ assertWriterWrite(t, w, nil, len("first\nsecond"))
proto := newProtocolRW(&buf, nil)
assertPacketRead(t, proto, []byte("first\nsecond"))
@@ -74,7 +74,7 @@ func TestPacketWriterWritesMultiplePacketsGreaterThanMaxPacketLength(t *testing.
w := NewPacketWriter(&buf)
assertWriterWrite(t, w, p1, 0)
assertWriterWrite(t, w, p2, MaxPacketLength)
- assertWriterWrite(t, w, []byte{}, (len(b1)+len(b2))-MaxPacketLength)
+ assertWriterWrite(t, w, nil, (len(b1)+len(b2))-MaxPacketLength)
// offs is how far into b2 we needed to buffer before writing an entire
// packet
|
git/pw: only flush packets with nil slice
|
git-lfs_git-lfs
|
train
|
27390a15bd30f2004257a2737ee539fe08390551
|
diff --git a/src/Error/ExceptionRenderer.php b/src/Error/ExceptionRenderer.php
index <HASH>..<HASH> 100644
--- a/src/Error/ExceptionRenderer.php
+++ b/src/Error/ExceptionRenderer.php
@@ -44,7 +44,7 @@ class ExceptionRenderer extends \Cake\Error\ExceptionRenderer
'_serialize' => ['code', 'url', 'message', 'errorCount', 'errors']
];
$this->controller->set($sets);
- $this->_outputMessage('error400');
+ return $this->_outputMessage('error400');
}
/**
diff --git a/src/Listener/ApiListener.php b/src/Listener/ApiListener.php
index <HASH>..<HASH> 100644
--- a/src/Listener/ApiListener.php
+++ b/src/Listener/ApiListener.php
@@ -2,6 +2,7 @@
namespace Crud\Listener;
use Cake\Core\Configure;
+use Cake\Error\Handler;
use Cake\Event\Event;
use Cake\Network\Exception\BadRequestException;
use Cake\Network\Request;
@@ -151,7 +152,8 @@ class ApiListener extends BaseListener
*/
public function registerExceptionHandler()
{
- Configure::write('Error.exceptionRenderer', 'Crud\Error\ExceptionRenderer');
+ $config = ['exceptionRenderer' => 'Crud\Error\ExceptionRenderer'];
+ (new ErrorHandler($config))->register();
}
/**
|
Fix API exception rendering
As it was, the `ExceptionRenderer` was not being registered by the listener
and the `Cake\Network\Response` was not properly returned on validation
exception rendering.
|
FriendsOfCake_crud-json-api
|
train
|
85648c69b0526a597c450852791f46804e56f641
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,6 +1,6 @@
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
-require 'simplecov'
+require 'simplecov' # Used filters are in /.simplecov
require 'rspec/its'
require 'webmock/rspec'
require 'active_support/time'
@@ -10,12 +10,6 @@ if ENV['TRAVIS']
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
end
-SimpleCov.start do
- add_filter '/example/'
- add_filter '/spec/'
- add_filter 'helper'
-end
-
# See http://betterspecs.org/
RSpec.configure do |config|
config.expect_with :rspec do |c|
|
Moves simplecov filters in config file
|
wpscanteam_CMSScanner
|
train
|
7a02e640a4583725dc906fc6ee3f6335ba697863
|
diff --git a/addon/orm/collection.js b/addon/orm/collection.js
index <HASH>..<HASH> 100644
--- a/addon/orm/collection.js
+++ b/addon/orm/collection.js
@@ -1,10 +1,13 @@
import _invoke from 'lodash/collection/invoke';
import assert from '../assert';
-/*
- An array of models, returned from one of the schema query
- methods (all, find, where). Knows how to update and destroy its models.
-*/
+/**
+ * An array of models, returned from one of the schema query
+ * methods (all, find, where). Knows how to update and destroy its models.
+ * @class Collection
+ * @constructor
+ * @public
+ */
export default class Collection {
constructor(modelName, models = []) {
assert(
@@ -16,36 +19,74 @@ export default class Collection {
this.models = models;
}
+ /**
+ * Updates each model in the collection (persisting immediately to the db).
+ * @method update
+ * @param key
+ * @param val
+ * @return this
+ * @public
+ */
update(...args) {
_invoke(this.models, 'update', ...args);
return this;
}
+ /**
+ * Destroys the db record for all models in the collection.
+ * @method destroy
+ * @return this
+ * @public
+ */
destroy() {
_invoke(this.models, 'destroy');
return this;
}
+ /**
+ * Saves all models in the collection.
+ * @method save
+ * @return this
+ * @public
+ */
save() {
_invoke(this.models, 'save');
return this;
}
+ /**
+ * Reloads each model in the collection.
+ * @method reload
+ * @return this
+ * @public
+ */
reload() {
_invoke(this.models, 'reload');
return this;
}
+ /**
+ * @method filter
+ * @param f
+ * @return {Collection}
+ * @public
+ */
filter(f) {
let filteredModels = this.models.filter(f);
return new Collection(this.modelName, filteredModels);
}
+ /**
+ * @method mergeCollection
+ * @param collection
+ * @return this
+ * @public
+ */
mergeCollection(collection) {
this.models = this.models.concat(collection.models);
|
adds YUIDoc comments to orm/collection.js (#<I>)
|
samselikoff_ember-cli-mirage
|
train
|
f6473c4aa8706a15c01b5f13d80440e08ad16684
|
diff --git a/visidata/loaders/_pandas.py b/visidata/loaders/_pandas.py
index <HASH>..<HASH> 100644
--- a/visidata/loaders/_pandas.py
+++ b/visidata/loaders/_pandas.py
@@ -22,3 +22,14 @@ class PandasSheet(Sheet):
def reload(self):
self.rows = DataFrameAdapter(self.source)
self.columns = [ColumnItem(col) for col in self.source.columns]
+
+
+def view_pandas(df):
+ run(PandasSheet('', source=df))
+
+
+def open_pandas(p):
+ import pandas
+ filetype = p.ext[1:]
+ readfunc = getattr(pandas, 'read_'+filetype)
+ return PandasSheet(p.name, source=readfunc(p.resolve()))
diff --git a/visidata/pyobj.py b/visidata/pyobj.py
index <HASH>..<HASH> 100644
--- a/visidata/pyobj.py
+++ b/visidata/pyobj.py
@@ -87,9 +87,6 @@ def push_pyobj(name, pyobj):
def view(obj):
run(load_pyobj(obj.__name__, obj))
-def view_pandas(df):
- run(PandasSheet('', source=df))
-
def load_pyobj(name, pyobj):
'Return Sheet object of appropriate type for given sources in `args`.'
if isinstance(pyobj, list) or isinstance(pyobj, tuple):
|
[pandas] "-f pandas" loads file with pandas.read_<ext>
|
saulpw_visidata
|
train
|
86cea0e8f48266b53bd05b0011cba78a22d52273
|
diff --git a/src/main/java/org/jooq/lambda/SeqUtils.java b/src/main/java/org/jooq/lambda/SeqUtils.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jooq/lambda/SeqUtils.java
+++ b/src/main/java/org/jooq/lambda/SeqUtils.java
@@ -51,7 +51,7 @@ class SeqUtils {
@Override
public Spliterator<U> trySplit() {
- return this;
+ return null;
}
@Override
|
[#<I>] Fix Spliterator implementation according to contract
|
jOOQ_jOOL
|
train
|
4ff8122656353c45d421103edffaf6be9660f8d4
|
diff --git a/spec/examples/record/record_set_spec.rb b/spec/examples/record/record_set_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/examples/record/record_set_spec.rb
+++ b/spec/examples/record/record_set_spec.rb
@@ -33,7 +33,7 @@ describe Cequel::Record::RecordSet do
model :PublishedPost do
key :blog_subdomain, :ascii
- key :published_at, :timeuuid
+ key :published_at, :timeuuid, order: :desc
column :permalink, :ascii, index: true
end
@@ -469,7 +469,7 @@ describe Cequel::Record::RecordSet do
it 'should query Time range for Timeuuid key' do
PublishedPost['cassandra'].after(now - 3.minutes).map(&:permalink).
- should == %w(cequel2 cequel3 cequel4)
+ should == %w(cequel4 cequel3 cequel2)
end
end
@@ -488,7 +488,7 @@ describe Cequel::Record::RecordSet do
it 'should query Time range for Timeuuid key' do
PublishedPost['cassandra'].from(now - 3.minutes).map(&:permalink).
- should == %w(cequel1 cequel2 cequel3 cequel4)
+ should == %w(cequel4 cequel3 cequel2 cequel1)
end
it 'should raise ArgumentError when called on partition key' do
@@ -507,7 +507,7 @@ describe Cequel::Record::RecordSet do
it 'should query Time range for Timeuuid key' do
PublishedPost['cassandra'].before(now - 1.minute).map(&:permalink).
- should == %w(cequel0 cequel1 cequel2)
+ should == %w(cequel2 cequel1 cequel0)
end
it 'should cast argument' do
@@ -531,7 +531,7 @@ describe Cequel::Record::RecordSet do
it 'should query Time range for Timeuuid key' do
PublishedPost['cassandra'].upto(now - 1.minute).map(&:permalink).
- should == %w(cequel0 cequel1 cequel2 cequel3)
+ should == %w(cequel3 cequel2 cequel1 cequel0)
end
end
@@ -556,35 +556,35 @@ describe Cequel::Record::RecordSet do
it 'should query Time range for Timeuuid key' do
PublishedPost['cassandra'].in((now - 3.minutes)..(now - 1.minute)).
- map(&:permalink).should == %w(cequel1 cequel2 cequel3)
+ map(&:permalink).should == %w(cequel3 cequel2 cequel1)
end
it 'should query Time range for Timeuuid key with exclusive upper bound' do
PublishedPost['cassandra'].in((now - 3.minutes)...(now - 1.minute)).
- map(&:permalink).should == %w(cequel1 cequel2)
+ map(&:permalink).should == %w(cequel2 cequel1)
end
end
describe '#reverse' do
- let(:records) { [posts, comments] }
+ let(:records) { [published_posts, comments] }
it 'should not call the database' do
disallow_queries!
- Post['cassandra'].reverse
+ PublishedPost['cassandra'].reverse
end
it 'should return collection in reverse' do
- Post['cassandra'].reverse.map(&:title).
- should == (0...5).map { |i| "Cequel #{i}" }.reverse
+ PublishedPost['cassandra'].reverse.map(&:permalink).
+ should == (0...5).map { |i| "cequel#{i}" }
end
it 'should batch iterate over collection in reverse' do
- Post['cassandra'].reverse.find_each(:batch_size => 2).map(&:title).
- should == (0...5).map { |i| "Cequel #{i}" }.reverse
+ PublishedPost['cassandra'].reverse.find_each(:batch_size => 2).map(&:permalink).
+ should == (0...5).map { |i| "cequel#{i}" }
end
it 'should raise an error if range key is a partition key' do
- expect { Post.all.reverse }.to raise_error(Cequel::Record::IllegalQuery)
+ expect { PublishedPost.all.reverse }.to raise_error(Cequel::Record::IllegalQuery)
end
it 'should use the correct ordering column in deeply nested models' do
|
Set `order` to `:desc` on `PublishedPost` model to be able to properly test the `#reverse` method; test examples impacted by this change are adapted (reversed expected results); now using `PublishedPost` instead of `Post` for the `#reverse` examples.
|
cequel_cequel
|
train
|
cb1d64f6ad698b32dac194dc3e4126af4431ebc3
|
diff --git a/lib/rules/handle-callback-err.js b/lib/rules/handle-callback-err.js
index <HASH>..<HASH> 100644
--- a/lib/rules/handle-callback-err.js
+++ b/lib/rules/handle-callback-err.js
@@ -92,12 +92,17 @@ module.exports = function(context) {
// make sure the node's name matches our error argument name
var isAboutError = node.name === callback.errorVariableName;
- // we don't consider these use cases as "handling" the error
+ // we don't consider being params in these use cases as "handling" the error
var doNotCount = ["FunctionDeclaration", "ArrowFunctionExpression", "FunctionExpression", "CatchClause"];
// make sure this identifier isn't used as part of one of them
var isHandled = doNotCount.indexOf(node.parent.type) === -1;
+ // special handling for arrow function expressions where we return the error
+ if (node.parent.type === "ArrowFunctionExpression" && node === node.parent.body) {
+ isHandled = true;
+ }
+
if (isAboutError && isHandled) {
// record that this callback handled its error
callback.handled = true;
diff --git a/tests/lib/rules/handle-callback-err.js b/tests/lib/rules/handle-callback-err.js
index <HASH>..<HASH> 100644
--- a/tests/lib/rules/handle-callback-err.js
+++ b/tests/lib/rules/handle-callback-err.js
@@ -41,6 +41,9 @@ eslintTester.addRuleTest("lib/rules/handle-callback-err", {
"function userHandler(err) {process.nextTick(function() {if (err) {}})}",
"function help() { function userHandler(err) {function tester() { err; process.nextTick(function() { err; }); } } }",
"function help(done) { var err = new Error('error'); done(); }",
+ { code: "var test = err => err;", ecmaFeatures: { arrowFunctions: true } },
+ { code: "var test = err => !err;", ecmaFeatures: { arrowFunctions: true } },
+ { code: "var test = err => err.message;", ecmaFeatures: { arrowFunctions: true } },
{ code: "var test = function(error) {if(error){/* do nothing */}};", args: [2, "error"] },
{ code: "var test = (error) => {if(error){/* do nothing */}};", args: [2, "error"], ecmaFeatures: { arrowFunctions: true } },
{ code: "var test = function(error) {if(! error){doSomethingHere();}};", args: [2, "error"] },
|
Fix: handle-callback-err missing arrow functions (fixes #<I>)
|
eslint_eslint
|
train
|
9ad5e3bf3663d15e1de9fad1c2a5ae25bdc2e98a
|
diff --git a/deep.js b/deep.js
index <HASH>..<HASH> 100644
--- a/deep.js
+++ b/deep.js
@@ -89,14 +89,21 @@ define(["require", "./utils", "./deep-rql", "./deep-schema", "./deep-query", "./
* @property compose
* @type {Object}
*/
- deep.compose = require("./deep-compose")(deep);
+ require("./deep-compose")(deep);
/**
* final namespace for deepjs/deep-collider
* @static
* @property collider
* @type {Object}
*/
- deep.collider = require("./deep-collider")(deep);
+ require("./deep-collider")(deep);
+ /**
+ * final namespace for deepjs/utils
+ * @static
+ * @property utils
+ * @type {Object}
+ */
+ var utils = deep.utils = require("./utils")(deep);
/**
* rethrow any throw during chain execution.
* @property rethrow
@@ -105,13 +112,7 @@ define(["require", "./utils", "./deep-rql", "./deep-schema", "./deep-query", "./
*/
deep.rethrow = false;
deep.metaSchema = {};
- /**
- * final namespace for deepjs/utils
- * @static
- * @property utils
- * @type {Object}
- */
- var utils = deep.utils = require("./utils")(deep);
+
/**
* perform a (synched) deep-rql filter on array
* @example
@@ -211,26 +212,6 @@ define(["require", "./utils", "./deep-rql", "./deep-schema", "./deep-query", "./
*/
deep.globalHaders = {};
- // deep mode management
- deep.modes = function(arg, arg2){
- return deep({}).modes(arg, arg2);
- };
-
- deep.setModes = function(arg, arg2){
- // console.log("generalMode : ", arguments)
- if(typeof arg === 'string')
- {
- var obj = {};
- obj[arg] = arg2;
- arg = obj;
- }
- deep.context = deep.utils.simpleCopy(deep.context);
- for(var i in deep.context.modes)
- if(!arg[i] && deep.context.modes.hasOwnProperty(i))
- arg[i] = deep.context.modes[i];
- deep.context.modes = arg;
- };
-
deep.destructiveLoad = false;
var addInChain = deep.utils.addInChain = function (handle) {
@@ -2497,6 +2478,7 @@ define(["require", "./utils", "./deep-rql", "./deep-schema", "./deep-query", "./
"js::deepjs/units/collisions",
"js::deepjs/units/colliders",
"js::deepjs/units/compositions",
+ // "js::deepjs/units/compose2",
"js::deepjs/units/flatten",
"js::deepjs/units/promises",
"js::deepjs/units/chain",
|
extract last OCM stuffs + change from colliders + compositions refactoring
|
deepjs_deepjs
|
train
|
b8f97bd0acfb34f26c2fffe16841e1099af870e8
|
diff --git a/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/config/CredentialFactory.java b/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/config/CredentialFactory.java
index <HASH>..<HASH> 100644
--- a/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/config/CredentialFactory.java
+++ b/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/config/CredentialFactory.java
@@ -15,19 +15,16 @@
*/
package com.google.cloud.bigtable.config;
-import com.google.api.client.extensions.appengine.http.UrlFetchTransport;
-import com.google.api.client.http.HttpTransport;
-import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.util.SecurityUtils;
import com.google.auth.Credentials;
import com.google.auth.http.HttpTransportFactory;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.auth.oauth2.ServiceAccountCredentials;
import com.google.auth.oauth2.ServiceAccountJwtAccessCredentials;
-import com.google.cloud.PlatformInformation;
import com.google.cloud.bigtable.config.CredentialOptions.JsonCredentialsOptions;
import com.google.cloud.bigtable.config.CredentialOptions.P12CredentialOptions;
import com.google.cloud.bigtable.config.CredentialOptions.UserSuppliedCredentialOptions;
+import com.google.cloud.http.HttpTransportOptions.DefaultHttpTransportFactory;
import com.google.common.collect.ImmutableList;
import java.io.FileInputStream;
import java.io.IOException;
@@ -80,21 +77,6 @@ public class CredentialFactory {
CredentialFactory.httpTransportFactory = httpTransportFactory;
}
- private static class DefaultHttpTransportFactory implements HttpTransportFactory {
- @Override
- public HttpTransport create() {
- // Consider App Engine Standard
- if (PlatformInformation.isOnGAEStandard7() || PlatformInformation.isOnGAEStandard8()) {
- try {
- return new UrlFetchTransport();
- } catch (Exception e) {
- // ignore. May not be on AppEngine.
- }
- }
- return new NetHttpTransport();
- }
- }
-
public static HttpTransportFactory getHttpTransportFactory() {
if (httpTransportFactory == null) {
httpTransportFactory = new DefaultHttpTransportFactory();
|
Fixing Credential unavailable issue in GAE (#<I>)
Removed GAE8Java8Standard8 check from CredentialFactory as UrlFetchTransport does not work with GAE8.
Using GCJ's `HttpTransportOptions.DefaultHttpTransportFactory`.
Formatted the `CredentialFactory.java`
|
googleapis_cloud-bigtable-client
|
train
|
4cb623985b69fb03c873e011ed27f6cd149abb99
|
diff --git a/master/buildbot/test/unit/test_worker_docker.py b/master/buildbot/test/unit/test_worker_docker.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/test/unit/test_worker_docker.py
+++ b/master/buildbot/test/unit/test_worker_docker.py
@@ -104,14 +104,15 @@ class TestDockerLatentWorker(unittest.SynchronousTestCase):
bs.hostconfig, {'network_mode': 'fake', 'dns': ['1.1.1.1', '1.2.3.4']})
def test_start_instance_volume_renderable(self):
- bs = self.setupWorker('bot', 'pass', 'tcp://1234:2375', 'worker', ['bin/bash'],
- volumes=[Interpolate('/data:/buildslave/%(kw:builder)s/build',
- builder=Property('builder'))])
+ bs = self.setupWorker(
+ 'bot', 'pass', 'tcp://1234:2375', 'worker', ['bin/bash'],
+ volumes=[Interpolate('/data:/worker/%(kw:builder)s/build',
+ builder=Property('builder'))])
id, name = self.successResultOf(bs.start_instance(self.build))
client = docker.Client.latest
self.assertEqual(len(client.call_args_create_container), 1)
self.assertEqual(client.call_args_create_container[0]['volumes'],
- ['/buildslave/docker_worker/build'])
+ ['/worker/docker_worker/build'])
def test_volume_no_suffix(self):
bs = self.setupWorker(
@@ -145,9 +146,10 @@ class TestDockerLatentWorker(unittest.SynchronousTestCase):
volumes=['abcd=efgh'])
def test_volume_bad_format_renderable(self):
- bs = self.setupWorker('bot', 'pass', 'http://localhost:2375', image="worker",
- volumes=[Interpolate('/data==/buildslave/%(kw:builder)s/build',
- builder=Property('builder'))])
+ bs = self.setupWorker(
+ 'bot', 'pass', 'http://localhost:2375', image="worker",
+ volumes=[Interpolate('/data==/worker/%(kw:builder)s/build',
+ builder=Property('builder'))])
f = self.failureResultOf(bs.start_instance(self.build))
f.check(config.ConfigErrors)
|
rename "slave" to "worker" in example directory
|
buildbot_buildbot
|
train
|
d2ea2214d80248f468522ab2d3a5777f6c0d0bb4
|
diff --git a/cdm/src/main/java/thredds/cataloggen/CatGenAndWrite.java b/cdm/src/main/java/thredds/cataloggen/CatGenAndWrite.java
index <HASH>..<HASH> 100644
--- a/cdm/src/main/java/thredds/cataloggen/CatGenAndWrite.java
+++ b/cdm/src/main/java/thredds/cataloggen/CatGenAndWrite.java
@@ -111,7 +111,8 @@ public class CatGenAndWrite
// Test case 1: local data files served by TDS.
String collectionPath = "C:/Ethan/data/mlode";
String startPath = "grid/NCEP";
- String catWriteDirPath = "C:/Ethan/data/tmpTest2";
+ String catWriteDirPath = "C:/Ethan/code/svnThredds/tds/content/thredds/catGenAndWrite";
+ //String catWriteDirPath = "C:/Ethan/data/tmpTest2";
if ( args.length == 3 )
{
@@ -128,7 +129,7 @@ public class CatGenAndWrite
CrawlableDatasetFilter filter = null;
CrawlableDataset topCatCrDs = collectionCrDs.getDescendant( startPath );
- CatGenAndWrite cgaw = new CatGenAndWrite( "DATA", "My data", "tdr", service,
+ CatGenAndWrite cgaw = new CatGenAndWrite( "DATA", "My data", "mlode", service,
collectionCrDs, topCatCrDs, filter, catWriteDir );
try
|
Fix CatGenAndWrite main?() example for TDS datasetRoot stuff.
|
Unidata_thredds
|
train
|
019eefb1233e3313d68ed1239a32145acfb08335
|
diff --git a/tests/unit/CubicMushroom/Slim/ServiceManager/ServiceManagerTest.php b/tests/unit/CubicMushroom/Slim/ServiceManager/ServiceManagerTest.php
index <HASH>..<HASH> 100644
--- a/tests/unit/CubicMushroom/Slim/ServiceManager/ServiceManagerTest.php
+++ b/tests/unit/CubicMushroom/Slim/ServiceManager/ServiceManagerTest.php
@@ -36,7 +36,7 @@ class ServiceManagerTest extends \PHPUnit_Framework_TestCase
$this->assertInstanceOf(
'CubicMushroom\Slim\ServiceManager\ServiceManager',
- $app->container->get(ServiceManager::DEFAULT_SERVICE_NAME)
+ $app->container->get('@' . ServiceManager::DEFAULT_SERVICE_NAME)
);
}
@@ -53,7 +53,7 @@ class ServiceManagerTest extends \PHPUnit_Framework_TestCase
$this->assertInstanceOf(
'CubicMushroom\Slim\ServiceManager\ServiceManager',
- $app->container->get($serviceName)
+ $app->container->get('@' . $serviceName)
);
}
@@ -83,7 +83,7 @@ class ServiceManagerTest extends \PHPUnit_Framework_TestCase
$this->assertInstanceOf(
'\CubicMushroom\Slim\ServiceManager\ServiceManager',
- $app->container->get(ServiceManager::DEFAULT_SERVICE_NAME)
+ $app->container->get('@' . ServiceManager::DEFAULT_SERVICE_NAME)
);
}
@@ -112,7 +112,7 @@ class ServiceManagerTest extends \PHPUnit_Framework_TestCase
$this->assertInstanceOf(
'\CubicMushroom\Slim\ServiceManager\ServiceManager',
- $app->container->get(ServiceManager::DEFAULT_SERVICE_NAME)
+ $app->container->get('@' . ServiceManager::DEFAULT_SERVICE_NAME)
);
}
@@ -132,7 +132,7 @@ class ServiceManagerTest extends \PHPUnit_Framework_TestCase
$this->assertInstanceOf(
'\CubicMushroom\Slim\ServiceManager\ServiceManager',
- $app->container->get(ServiceManager::DEFAULT_SERVICE_NAME)
+ $app->container->get('@' . ServiceManager::DEFAULT_SERVICE_NAME)
);
}
|
Updated ServiceManagerTest to reflect '@' prefixing of own service name
|
cubicmushroom_slim-service-manager
|
train
|
93f3e8b864d0e114ba0f589de4d94f4308d5fb67
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -1,10 +1,10 @@
#!/usr/bin/env node
if(process.argv[2] == "--help" || process.argv[2] == "-h"){
- console.log();
+ //console.log();
var fs = require('fs');
- console.log(fs.readFileSync(__dirname + "/help", 'utf-8'));
- console.log();
+ //console.log(fs.readFileSync(__dirname + "/help", 'utf-8'));
+ //console.log();
process.exit(1);
}
diff --git a/os/nushi/stubbydb/configbuilder.js b/os/nushi/stubbydb/configbuilder.js
index <HASH>..<HASH> 100644
--- a/os/nushi/stubbydb/configbuilder.js
+++ b/os/nushi/stubbydb/configbuilder.js
@@ -39,7 +39,7 @@ var setConfig = function(path, value) {
exports.buildConfig = function(options,count){
if(options['-c'] && !options['-d']){
if(!fileutil.isExist(options['-c'])){
- console.log(options['-c'] + " doesn't exist");
+ logger.info(options['-c'] + " doesn't exist");
}
var jsonconfig = JSON.parse(fs.readFileSync(options['-c'],{encoding: 'utf-8'}));
buildFromJsonConfig(jsonconfig);
diff --git a/os/nushi/stubbydb/loaders/dbset_loader.js b/os/nushi/stubbydb/loaders/dbset_loader.js
index <HASH>..<HASH> 100644
--- a/os/nushi/stubbydb/loaders/dbset_loader.js
+++ b/os/nushi/stubbydb/loaders/dbset_loader.js
@@ -3,6 +3,7 @@ var fs = require('fs'),
path = require('path');
var lineReader = require('line-reader');
var deasync = require('deasync');
+var logger = require('./../log');
var dirPath = require("./../configbuilder").getConfig().dbsets;
var dbsets = [];
@@ -13,7 +14,7 @@ if(dirPath){
throw new Error(err);
}
files.forEach(function (name) {
- console.log("Loading DB from " + name);
+ logger.info("Loading DB from " + name);
var hashtable = new HashTable();
var filePath = path.join(dirPath, name);
var stat = fs.statSync(filePath);
diff --git a/os/nushi/stubbydb/loaders/mappings_loader.js b/os/nushi/stubbydb/loaders/mappings_loader.js
index <HASH>..<HASH> 100644
--- a/os/nushi/stubbydb/loaders/mappings_loader.js
+++ b/os/nushi/stubbydb/loaders/mappings_loader.js
@@ -1,7 +1,7 @@
var YAML = require('yamljs');
var config = require("./../configbuilder").getConfig()
var color = require('./../util/colors').color;
-
+var logger = require('./../log');
var config_mapping = config.mappings;
var allMappings = [];
@@ -13,14 +13,14 @@ for(var i in config_mapping.requests){
try{
var mappings = YAML.parseFile(req_mapping);
}catch(e){
- console.log(color("Problem in loading " + req_mapping, 'Red'))
+ logger.info(color("Problem in loading " + req_mapping, 'Red'))
}
if(!mappings || mappings.length == 0){
- console.log(req_mapping + " is an empty file.");
+ logger.info(req_mapping + " is an empty file.");
continue;
}
- console.log("Loading "+ mappings.length +" mappings from " + req_mapping);
+ logger.info("Loading "+ mappings.length +" mappings from " + req_mapping);
for(var i=0;i<mappings.length;i++){
diff --git a/os/nushi/stubbydb/log.js b/os/nushi/stubbydb/log.js
index <HASH>..<HASH> 100644
--- a/os/nushi/stubbydb/log.js
+++ b/os/nushi/stubbydb/log.js
@@ -21,7 +21,7 @@ if(quietLog){
errlogpath = path.join(dirPath,"exceptions.log");
}
- console.log("writing logs to: " + debuglogpath +", "+ errlogpath);
+ //console.log("writing logs to: " + debuglogpath +", "+ errlogpath);
filelogger = new (winston.Logger)({
transports: [
@@ -79,7 +79,9 @@ function isExist(path){
}
}
-/*process.on('uncaughtException', function (err) {
- exports.error(err);
- //process.exit(1); //want the server keep running
-});*/
\ No newline at end of file
+if(quietLog){
+ process.on('uncaughtException', function (err) {
+ exports.error(err);
+ //process.exit(1); //want the server keep running
+ });
+}
\ No newline at end of file
diff --git a/package.json b/package.json
index <HASH>..<HASH> 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "stubby-db",
- "version": "3.1.2",
+ "version": "3.1.3",
"description": "A complete solution for maintaining stubs for rapid development",
"main": "./os/nushi/stubbydb/stubbyDB",
"scripts": {
|
Disabling any direct logging to console until -v option is specified
|
NaturalIntelligence_StubbyDB
|
train
|
c4f99b5c0091379d48c2a10481a3c3e241b1592a
|
diff --git a/retrying.py b/retrying.py
index <HASH>..<HASH> 100644
--- a/retrying.py
+++ b/retrying.py
@@ -49,13 +49,16 @@ class Retrying:
wait_incrementing_start=0, wait_incrementing_increment=100,
wait_exponential_multiplier=1, wait_exponential_max=sys.maxint,
retry_on_exception=None,
- retry_on_result=None):
+ retry_on_result=None,
+ wrap_exception=False):
+ # TODO add chaining of stop behaviors
# stop behavior
self.stop = getattr(self, stop)
self._stop_max_attempt_number = stop_max_attempt_number
self._stop_max_delay = stop_max_delay
+ # TODO add chaining of wait behaviors
# wait behavior
self.wait = getattr(self, wait)
self._wait_fixed = wait_fixed
@@ -72,35 +75,44 @@ class Retrying:
else:
self._retry_on_exception = retry_on_exception
+ # TODO simplify retrying by Exception types
# retry on result filter
if retry_on_result is None:
self._retry_on_result = self.never_reject
else:
self._retry_on_result = retry_on_result
+ self._wrap_exception = wrap_exception
+
def never_stop(self, previous_attempt_number, delay_since_first_attempt_ms):
"""Never stop retrying."""
return False
def stop_after_attempt(self, previous_attempt_number, delay_since_first_attempt_ms):
- """Stop after the previous attempt >= max attempt number."""
+ """Stop after the previous attempt >= stop_max_attempt_number."""
return previous_attempt_number >= self._stop_max_attempt_number
def stop_after_delay(self, previous_attempt_number, delay_since_first_attempt_ms):
- """Stop after the delay from the first >= max delay."""
+ """Stop after the time from the first attempt >= stop_max_delay."""
return delay_since_first_attempt_ms >= self._stop_max_delay
def no_sleep(self, previous_attempt_number, delay_since_first_attempt_ms):
- """Return 0, don't sleep at all before retrying."""
+ """Don't sleep at all before retrying."""
return 0
def fixed_sleep(self, previous_attempt_number, delay_since_first_attempt_ms):
+ """Sleep a fixed amount of time between each retry."""
return self._wait_fixed
def random_sleep(self, previous_attempt_number, delay_since_first_attempt_ms):
+ """Sleep a random amount of time between wait_random_min and wait_random_max"""
return random.randint(self._wait_random_min, self._wait_random_max)
def incrementing_sleep(self, previous_attempt_number, delay_since_first_attempt_ms):
+ """
+ Sleep an incremental amount of time after each attempt, starting at
+ wait_incrementing_start and incrementing by wait_incrementing_increment
+ """
result = self._wait_incrementing_start + (self._wait_incrementing_increment * (previous_attempt_number - 1))
if result < 0:
result = 0
@@ -135,16 +147,16 @@ class Retrying:
attempt_number = 1
while True:
try:
- attempt = Attempt(fn(*args, **kwargs), False)
+ attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
except BaseException as e:
- attempt = Attempt(e, True)
+ attempt = Attempt(e, attempt_number, True)
if not self.should_reject(attempt):
- return attempt.get()
+ return attempt.get(self._wrap_exception)
delay_since_first_attempt_ms = int(round(time.time() * 1000)) - start_time
if self.stop(attempt_number, delay_since_first_attempt_ms):
- raise RetryError(attempt_number, attempt)
+ raise RetryError(attempt)
else:
sleep = self.wait(attempt_number, delay_since_first_attempt_ms)
time.sleep(sleep / 1000.0)
@@ -152,22 +164,38 @@ class Retrying:
attempt_number += 1
class Attempt:
+ """
+ An Attempt encapsulates a call to a target function that may end as a
+ normal return value from the function or an Exception depending on what
+ occurred during the execution.
+ """
- def __init__(self, value, has_exception):
+ def __init__(self, value, attempt_number, has_exception):
self.value = value
+ self.attempt_number = attempt_number
self.has_exception = has_exception
- def get(self):
+ def get(self, wrap_exception=False):
+ """
+ Return the return value of this Attempt instance or raise an Exception.
+ If wrap_exception is true, this Attempt is wrapped inside of a
+ RetryError before being raised.
+ """
if self.has_exception:
- raise self.value
+ if wrap_exception:
+ raise RetryError(self)
+ else:
+ raise self.value
else:
return self.value
class RetryError(Exception):
+ """
+ A RetryError encapsulates the last Attempt instance right before giving up.
+ """
- def __init__(self, failed_attempts, last_attempt):
- self.failed_attempts = failed_attempts
+ def __init__(self, last_attempt):
self.last_attempt = last_attempt
def __str__(self):
- return "Failed attempts: %s, Last attempt: %s" % (str(self.failed_attempts), str(self.last_attempt))
+ return "Last attempt: %s" % str(self.last_attempt)
|
add configurable support for wrapping any raised Exception in a RetryError instead of just raising it directly, add a few more comments
|
jd_tenacity
|
train
|
1b2a7d90af49b19409dcb151f922f124f797a290
|
diff --git a/lib/puppet.rb b/lib/puppet.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet.rb
+++ b/lib/puppet.rb
@@ -59,8 +59,7 @@ module Puppet
# configuration parameter access and stuff
def self.[](param)
- case param
- when :debug
+ if param == :debug
return Puppet::Util::Log.level == :debug
else
return @@settings[param]
|
case seems needless here as there is only two opts, also the rest of the file seems to use if so this should make things more consistant
|
puppetlabs_puppet
|
train
|
206fea6cb57b3bc5fb6dd977104c15bc202e469d
|
diff --git a/system/modules/generalDriver/DcGeneral/Contao/View/Contao2BackendView/ListView.php b/system/modules/generalDriver/DcGeneral/Contao/View/Contao2BackendView/ListView.php
index <HASH>..<HASH> 100644
--- a/system/modules/generalDriver/DcGeneral/Contao/View/Contao2BackendView/ListView.php
+++ b/system/modules/generalDriver/DcGeneral/Contao/View/Contao2BackendView/ListView.php
@@ -203,7 +203,7 @@ class ListView extends BaseView
$this->generateButtons(
$objModel,
$definition->getName(),
- $environment->getRootIds(),
+ null, // $environment->getRootIds(),
false,
null,
$previous,
diff --git a/system/modules/generalDriver/DcGeneral/Contao/View/Contao2BackendView/ParentView.php b/system/modules/generalDriver/DcGeneral/Contao/View/Contao2BackendView/ParentView.php
index <HASH>..<HASH> 100644
--- a/system/modules/generalDriver/DcGeneral/Contao/View/Contao2BackendView/ParentView.php
+++ b/system/modules/generalDriver/DcGeneral/Contao/View/Contao2BackendView/ParentView.php
@@ -182,7 +182,7 @@ class ParentView extends BaseView
$buttons = $this->generateButtons(
$model,
$definition->getName(),
- $environment->getRootIds(),
+ null, // $environment->getRootIds(),
false,
null,
$previous,
|
Temporarily get rid of $environment->getRootIds() in ListView and ParentView.
|
contao-community-alliance_dc-general
|
train
|
b08be9e173aa2b3646fb92bb8498b85b76d26b64
|
diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -15,7 +15,7 @@
import os
import sys
-sys.path.insert(0, os.path.abspath(".."))
+sys.path.insert(0, os.path.abspath("../src"))
autodoc_mock_imports = [
"bs4",
|
Update path used in readthedocs
Fixes the issue where modules were not being populated because fonduer
was nested in the `src` directory.
|
HazyResearch_fonduer
|
train
|
b187493df938c8f8bbf6bfd71421f627ae3e5c22
|
diff --git a/README.md b/README.md
index <HASH>..<HASH> 100644
--- a/README.md
+++ b/README.md
@@ -95,6 +95,39 @@ MessageQueue.disconnect
puts MessageQueue.connected? # => false
```
+You could also mix in the `MessageQueue::Producible` module and the
+`MessageQueue::Consumable` module in your producer class and consumer
+class respectively. The consumer class needs to implement a `process`
+method which will be passed a `MessageQueue::Message` instance when it
+receives a message.
+
+```ruby
+class Producer
+ include MessageQueue::Producible
+
+ exchange :name => "time" :type => :topic
+ message :routing_key => "time.now", :mandatory => true
+end
+
+class Consumer
+ include MessageQueue::Consumable
+
+ queue :name => "print_time_now"
+ exchange :name => "time", routing_key => "time.#"
+
+ def process(message)
+ puts "Received message #{message.payload}"
+ end
+end
+
+MessageQueue.connect(:adater => :bunny, :serializer => :json)
+Producer.new.publish(Time.now.to_s)
+
+sleep 1
+
+MessageQueue.disconnect
+```
+
## Examples
See [examples](https://github.com/jingweno/message_queue/tree/master/examples).
diff --git a/lib/message_queue/consumable.rb b/lib/message_queue/consumable.rb
index <HASH>..<HASH> 100644
--- a/lib/message_queue/consumable.rb
+++ b/lib/message_queue/consumable.rb
@@ -1,6 +1,10 @@
+require "message_queue/logging"
+
module MessageQueue
+ # A module to mix in a consumer class, for example:
+ #
# class Consumer
- # include MessageQueue::Consumerable
+ # include MessageQueue::Consumable
#
# queue :name => "print_time_now"
# exchange :name => "time", routing_key => "time.#"
@@ -9,6 +13,9 @@ module MessageQueue
# ...
# end
# end
+ #
+ # The consumer class needs to implement the process method which will be passed
+ # a MessageQueue::Message instance when it receives a message.
module Consumable
include Logging
@@ -30,7 +37,6 @@ module MessageQueue
subscribe_options.merge!(options)
end
-
def queue_options
@queue_options ||= {}
end
diff --git a/lib/message_queue/producible.rb b/lib/message_queue/producible.rb
index <HASH>..<HASH> 100644
--- a/lib/message_queue/producible.rb
+++ b/lib/message_queue/producible.rb
@@ -1,4 +1,8 @@
+require "message_queue/logging"
+
module MessageQueue
+ # A module to mix in a producer class, for example:
+ #
# class Producer
# include MessageQueue::Producible
#
|
Document usage for Producible and Consumable
|
jingweno_message_queue
|
train
|
47f62d402186a1b3b98a72e51f3164ac868d9423
|
diff --git a/server/index.js b/server/index.js
index <HASH>..<HASH> 100644
--- a/server/index.js
+++ b/server/index.js
@@ -24,6 +24,19 @@ function register (server, options, next) {
log.info('config', 'Storing all data in memory only')
} else {
PouchDB.plugin(require('pouchdb-adapter-leveldb'))
+
+ // this is a temporary workaround until we replace options.db with options.PouchDB:
+ // https://github.com/hoodiehq/hoodie/issues/555
+ if (!options.paths) {
+ options.paths = {
+ data: '.hoodie',
+ public: 'public'
+ }
+ }
+ if (!options.paths.data) {
+ options.paths.data = '.hoodie'
+ }
+
options.db.prefix = path.join(options.paths.data, 'data' + path.sep)
log.info('config', 'No CouchDB URL provided, falling back to PouchDB')
log.info('config', 'Writing PouchDB database files to ' + options.db.prefix)
|
fix(server): throws if options.paths is not set
|
hoodiehq_hoodie
|
train
|
cac8b2ced9e740033301f907b2c5fb40040f4a4b
|
diff --git a/lib/trakt.js b/lib/trakt.js
index <HASH>..<HASH> 100644
--- a/lib/trakt.js
+++ b/lib/trakt.js
@@ -340,7 +340,8 @@ function getShownfo(showId,callback) {
extended: "full"
}).then(answer => {
var selectedShow = answer.title + " " + answer.year
- displayImage.fromURL("https://cdn.pixabay.com/photo/2018/05/04/04/07/nature-3373196_1280.jpg").then(image => {
+ mdb.tvImages({ id: answer.ids.tmdb }, (err, res) => {
+ displayImage.fromURL("https://image.tmdb.org/t/p/w154" + res.posters[0].file_path).then(image => {
console.log(image)
console.log("\n\n" +
columnify([{
@@ -375,6 +376,7 @@ function getShownfo(showId,callback) {
}
})
})
+ });
});
})
}
|
get poster from tmdb
|
ItzBlitz98_torrentflix
|
train
|
9d4748d084162118450a5eacde6d8b020bc90130
|
diff --git a/lib/rasn1/types/base.rb b/lib/rasn1/types/base.rb
index <HASH>..<HASH> 100644
--- a/lib/rasn1/types/base.rb
+++ b/lib/rasn1/types/base.rb
@@ -115,7 +115,11 @@ module Rasn1
if primitive?
raise ASN1Error, "malformed #{type} TAG (#@name): indefinite length forbidden for primitive types"
else
- raise ASN1Error, "TAG #@name: indefinite length not supported yet"
+ if ber
+ raise NotImplementedError, "TAG #@name: indefinite length not supported yet"
+ else
+ raise ASN1Error, "TAG #@name: indefinite length forbidden in DER encoding"
+ end
end
elsif length < INDEFINITE_LENGTH
der_to_value(der[2, length], ber: ber)
diff --git a/spec/types/base_spec.rb b/spec/types/base_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/types/base_spec.rb
+++ b/spec/types/base_spec.rb
@@ -94,7 +94,9 @@ module Rasn1::Types
expect { bool.parse!(der) }.to raise_error(Rasn1::ASN1Error).
with_message('malformed BOOLEAN TAG (bool): indefinite length forbidden for primitive types')
end
- it 'raises on indefinite length with constructed types'
+
+ it 'raises on indefinite length with constructed types on DER encoding'
+ it 'raises on indefinite length with constructed types on BER encoding'
end
end
end
|
Types::Base#parse!: differentiate BER and DER encoding on indefinite length
|
sdaubert_rasn1
|
train
|
204a34d62f4c96174a11a204c8851bb74d1954de
|
diff --git a/library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java b/library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java
index <HASH>..<HASH> 100644
--- a/library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java
+++ b/library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java
@@ -38,7 +38,6 @@ import android.widget.RelativeLayout;
import com.mikepenz.fastadapter.FastAdapter;
import com.mikepenz.fastadapter.IAdapter;
-import com.mikepenz.fastadapter.IItem;
import com.mikepenz.fastadapter.IItemAdapter;
import com.mikepenz.fastadapter.adapters.FooterAdapter;
import com.mikepenz.fastadapter.adapters.HeaderAdapter;
@@ -918,6 +917,7 @@ public class DrawerBuilder {
protected FastAdapter<IDrawerItem> getAdapter() {
if (mAdapter == null) {
mAdapter = new FastAdapter<>();
+ mAdapter.withAllowDeselection(false);
mAdapter.setHasStableIds(mHasStableIds);
//we wrap our main Adapter with the item hosting adapter
|
* dissallow deselection of an item via click
|
mikepenz_MaterialDrawer
|
train
|
469ff9d8dee1faa345f3facaac41ca4aa4bf24cd
|
diff --git a/dempsy-framework.core/src/main/java/net/dempsy/container/Container.java b/dempsy-framework.core/src/main/java/net/dempsy/container/Container.java
index <HASH>..<HASH> 100644
--- a/dempsy-framework.core/src/main/java/net/dempsy/container/Container.java
+++ b/dempsy-framework.core/src/main/java/net/dempsy/container/Container.java
@@ -332,6 +332,15 @@ public abstract class Container implements Service, KeyspaceChangeListener, Outp
occLogger.run();
+ if(!isRunningLazy) {
+ if(LOGGER.isDebugEnabled())
+ LOGGER.debug("Dispatch called on stopped container");
+ statCollector.messageFailed(1);
+ if(justArrived)
+ disposition.dispose(message.message);
+ return;
+ }
+
dispatch(message, justArrived);
}
diff --git a/dempsy-framework.impl/src/main/java/net/dempsy/container/altnonlocking/NonLockingAltContainer.java b/dempsy-framework.impl/src/main/java/net/dempsy/container/altnonlocking/NonLockingAltContainer.java
index <HASH>..<HASH> 100644
--- a/dempsy-framework.impl/src/main/java/net/dempsy/container/altnonlocking/NonLockingAltContainer.java
+++ b/dempsy-framework.impl/src/main/java/net/dempsy/container/altnonlocking/NonLockingAltContainer.java
@@ -221,13 +221,6 @@ public class NonLockingAltContainer extends Container {
// this is called directly from tests but shouldn't be accessed otherwise.
@Override
public void dispatch(final KeyedMessage keyedMessage, final boolean youOwnMessage) throws IllegalArgumentException, ContainerException {
- if(!isRunningLazy) {
- LOGGER.debug("Dispacth called on stopped container");
- statCollector.messageFailed(1);
- if(youOwnMessage)
- disposition.dispose(keyedMessage.message);
- }
-
if(keyedMessage == null)
return; // No. We didn't process the null message
diff --git a/dempsy-framework.impl/src/main/java/net/dempsy/container/altnonlockingbulk/NonLockingAltBulkContainer.java b/dempsy-framework.impl/src/main/java/net/dempsy/container/altnonlockingbulk/NonLockingAltBulkContainer.java
index <HASH>..<HASH> 100644
--- a/dempsy-framework.impl/src/main/java/net/dempsy/container/altnonlockingbulk/NonLockingAltBulkContainer.java
+++ b/dempsy-framework.impl/src/main/java/net/dempsy/container/altnonlockingbulk/NonLockingAltBulkContainer.java
@@ -68,13 +68,6 @@ public class NonLockingAltBulkContainer extends NonLockingAltContainer {
// this is called directly from tests but shouldn't be accessed otherwise.
@Override
public void dispatch(final KeyedMessage keyedMessage, final boolean youOwnMessage) throws IllegalArgumentException, ContainerException {
- if(!isRunningLazy) {
- LOGGER.debug("Dispacth called on stopped container");
- statCollector.messageFailed(1);
- if(youOwnMessage)
- disposition.dispose(keyedMessage.message);
- }
-
if(keyedMessage == null)
return; // No. We didn't process the null message
diff --git a/dempsy-framework.impl/src/main/java/net/dempsy/container/locking/LockingContainer.java b/dempsy-framework.impl/src/main/java/net/dempsy/container/locking/LockingContainer.java
index <HASH>..<HASH> 100644
--- a/dempsy-framework.impl/src/main/java/net/dempsy/container/locking/LockingContainer.java
+++ b/dempsy-framework.impl/src/main/java/net/dempsy/container/locking/LockingContainer.java
@@ -254,15 +254,6 @@ public class LockingContainer extends Container {
// this is called directly from tests but shouldn't be accessed otherwise.
@Override
public void dispatch(final KeyedMessage keyedMessage, final boolean youOwnMessage) throws IllegalArgumentException, ContainerException {
- if(!isRunningLazy) {
- if(LOGGER.isDebugEnabled())
- LOGGER.debug("Dispatch called on stopped container");
- statCollector.messageFailed(1);
- if(youOwnMessage)
- disposition.dispose(keyedMessage.message);
- return;
- }
-
if(keyedMessage == null)
return; // No. We didn't process the null message
diff --git a/dempsy-framework.impl/src/main/java/net/dempsy/container/nonlocking/NonLockingContainer.java b/dempsy-framework.impl/src/main/java/net/dempsy/container/nonlocking/NonLockingContainer.java
index <HASH>..<HASH> 100644
--- a/dempsy-framework.impl/src/main/java/net/dempsy/container/nonlocking/NonLockingContainer.java
+++ b/dempsy-framework.impl/src/main/java/net/dempsy/container/nonlocking/NonLockingContainer.java
@@ -256,13 +256,6 @@ public class NonLockingContainer extends Container {
@Override
public void dispatch(final KeyedMessage keyedMessage, final boolean youOwnMessage) throws IllegalArgumentException, ContainerException {
- if(!isRunningLazy) {
- LOGGER.debug("Dispacth called on stopped container");
- statCollector.messageFailed(1);
- if(youOwnMessage)
- disposition.dispose(keyedMessage.message);
- }
-
if(keyedMessage == null)
return; // No. We didn't process the null message
|
Clean up a race condition on shutdown during tests.
|
Dempsy_dempsy
|
train
|
2631945e81a94fb0fe7d776b2734cd206af4e8cc
|
diff --git a/suds/bindings/unmarshaller.py b/suds/bindings/unmarshaller.py
index <HASH>..<HASH> 100644
--- a/suds/bindings/unmarshaller.py
+++ b/suds/bindings/unmarshaller.py
@@ -318,7 +318,10 @@ class Typed(UMBase):
content.type = found
else:
self.resolver.push(content.type)
- data = Factory.object(content.type.get_name())
+ cls_name = content.type.get_name()
+ if cls_name is None:
+ cls_name = content.node.name
+ data = Factory.object(cls_name)
md = content.data.__metadata__
md.__type__ = content.type
diff --git a/suds/client.py b/suds/client.py
index <HASH>..<HASH> 100644
--- a/suds/client.py
+++ b/suds/client.py
@@ -415,11 +415,13 @@ class ServiceDefinition:
return ns[0]
raise Exception('ns (%s) not mapped' % u)
- def __xlate(self, t):
+ def __xlate(self, type):
""" get a (namespace) translated name for type """
- t = t.resolve()
- name = t.get_name()
- ns = t.namespace()
+ resolved = type.resolve()
+ name = resolved.get_name()
+ if type.unbounded():
+ name += '[]'
+ ns = resolved.namespace()
if ns[1] == self.wsdl.tns[1]:
return name
prefix = self.__getprefix(ns[1])
@@ -439,10 +441,9 @@ class ServiceDefinition:
sig.append(m[0])
sig.append('(')
for p in m[1]:
- sig.append(p[0])
- sig.append('{')
sig.append(self.__xlate(p[1]))
- sig.append('}')
+ sig.append(' ')
+ sig.append(p[0])
sig.append(', ')
sig.append(')')
s.append(''.join(sig))
|
Apply fix as defined by <EMAIL> in ticket #<I>; update service definition to print to display service methods as ' my_method(xs:int arg0, Person arg1) ' instead of ' my_method(arg0{xs:int}, arg1{Person}) ' which is more like traditional method signatures
|
suds-community_suds
|
train
|
ed58c3a40cb3b9487527b5ec6e87246c26bed473
|
diff --git a/src/Fiedsch/Data/Augmentation/Provider/TokenServiceProvider.php b/src/Fiedsch/Data/Augmentation/Provider/TokenServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/Fiedsch/Data/Augmentation/Provider/TokenServiceProvider.php
+++ b/src/Fiedsch/Data/Augmentation/Provider/TokenServiceProvider.php
@@ -18,7 +18,7 @@ class TokenServiceProvider implements ServiceProviderInterface
{
/**
- * @param Container $pimple the dependency injection container.
+ * @param Container $container the dependency injection container.
*/
public function register(Container $container)
{
diff --git a/src/Fiedsch/Data/Augmentation/Provider/UniquenessCheckerServiceProvider.php b/src/Fiedsch/Data/Augmentation/Provider/UniquenessCheckerServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/Fiedsch/Data/Augmentation/Provider/UniquenessCheckerServiceProvider.php
+++ b/src/Fiedsch/Data/Augmentation/Provider/UniquenessCheckerServiceProvider.php
@@ -18,7 +18,7 @@ class UniquenessCheckerServiceProvider implements ServiceProviderInterface
{
/**
- * @param Container $pimple the dependency injection container.
+ * @param Container $container the dependency injection container.
*/
public function register(Container $container)
{
diff --git a/src/Fiedsch/Data/File/CsvReader.php b/src/Fiedsch/Data/File/CsvReader.php
index <HASH>..<HASH> 100644
--- a/src/Fiedsch/Data/File/CsvReader.php
+++ b/src/Fiedsch/Data/File/CsvReader.php
@@ -117,7 +117,7 @@ class CsvReader extends Reader
/**
* Read the first line of the file and use it as header (column names).
*
- * @throws Exception if the current line is > 0, i.e. data was already read.
+ * @throws \Exception if the current line is > 0, i.e. data was already read.
*/
public function readHeader()
{
@@ -144,6 +144,8 @@ class CsvReader extends Reader
* @param array $line the line to check.
*
* @param boolean $strict controls how to compare "empty" strings (see also FileReader::isEmpty()).
+ *
+ * @return boolean
*/
public function isEmpty($line, $strict = false)
{
diff --git a/src/Fiedsch/Data/File/CsvWriter.php b/src/Fiedsch/Data/File/CsvWriter.php
index <HASH>..<HASH> 100644
--- a/src/Fiedsch/Data/File/CsvWriter.php
+++ b/src/Fiedsch/Data/File/CsvWriter.php
@@ -103,7 +103,7 @@ class CsvWriter extends Writer
/**
* Read and return the next line from the file.
*
- * @return array|null the data from next line of the file or null if there are no more lines.
+ * @param array $data
*/
public function printLine($data)
{
diff --git a/src/Fiedsch/Data/File/Reader.php b/src/Fiedsch/Data/File/Reader.php
index <HASH>..<HASH> 100644
--- a/src/Fiedsch/Data/File/Reader.php
+++ b/src/Fiedsch/Data/File/Reader.php
@@ -90,6 +90,8 @@ class Reader extends File
* @param string $line the line to check.
*
* @param boolean $strict if $strict is set to true, ' ' is not considered empty.
+ *
+ * @return boolean
*/
// NOTE to self: this function is not static as child classes such as CsvFileReader
// need to access class properties as e.g. the delimiter.
diff --git a/src/Fiedsch/Data/Utility/QuotaCell.php b/src/Fiedsch/Data/Utility/QuotaCell.php
index <HASH>..<HASH> 100644
--- a/src/Fiedsch/Data/Utility/QuotaCell.php
+++ b/src/Fiedsch/Data/Utility/QuotaCell.php
@@ -30,12 +30,12 @@ class QuotaCell
protected $targets;
/**
- * @param array $target
+ * @param array|int $target
*/
public function __construct($target)
{
$this->targets = is_array($target) ? $target : [ $target ];
- $this->counts = array_map(function($element) { return 0; }, $this->targets);
+ $this->counts = array_map(function() { return 0; }, $this->targets);
}
diff --git a/tests/Fiedsch/Data/Utility/QuotaCellTest.php b/tests/Fiedsch/Data/Utility/QuotaCellTest.php
index <HASH>..<HASH> 100644
--- a/tests/Fiedsch/Data/Utility/QuotaCellTest.php
+++ b/tests/Fiedsch/Data/Utility/QuotaCellTest.php
@@ -30,11 +30,11 @@ class QuotaCellTest extends PHPUnit_Framework_TestCase
{
$targets = ['x'=>10, 'y'=>20, 'z'=>30];
$cell = new QuotaCell($targets);
- $cell->add(5, 'a'); // index a is not defined in $targets!
+ $cell->add(5, 'a'); // index a is not defined
}
/**
- * test fallback to univariat target if default arguments are used
+ * test fallback to univariate target if default arguments are used
*/
public function testScalarCell()
{
|
fix (PHPDoc) comments
|
fiedsch_datamanagement
|
train
|
931acd178bfd16a1201f98f932189d4ba31b3a2c
|
diff --git a/lib/hector/channel.rb b/lib/hector/channel.rb
index <HASH>..<HASH> 100644
--- a/lib/hector/channel.rb
+++ b/lib/hector/channel.rb
@@ -29,7 +29,7 @@ module Hector
def normalize(name)
name.force_encoding("UTF-8") if name.respond_to?(:force_encoding)
- if name =~ /^[#&+!][\p{L}\p{M}\p{N}\p{So}\p{Co}\w][\p{L}\p{M}\p{N}\p{So}\p{Co}\p{Pd}\p{Pc}\w-]{0,15}$/u
+ if name =~ /^[#&+!][\w#&+!\-\p{L}\p{M}\p{N}\p{So}\p{Co}\p{Pd}\p{Pc}]{1,15}$/u
name.downcase
else
raise NoSuchChannel, name
diff --git a/test/integration/channels_test.rb b/test/integration/channels_test.rb
index <HASH>..<HASH> 100644
--- a/test/integration/channels_test.rb
+++ b/test/integration/channels_test.rb
@@ -30,6 +30,21 @@ module Hector
assert_no_such_channel c, "@test"
end
end
+
+ test :"channel names can contain prefix characters" do
+ authenticated_connection.tap do |c|
+ c.receive_line "JOIN ##"
+ assert_sent_to c, ":sam!sam@hector.irc JOIN :##"
+ c.receive_line "JOIN #test#"
+ assert_sent_to c, ":sam!sam@hector.irc JOIN :#test#"
+ c.receive_line "JOIN #&"
+ assert_sent_to c, ":sam!sam@hector.irc JOIN :#&"
+ c.receive_line "JOIN ++&#"
+ assert_sent_to c, ":sam!sam@hector.irc JOIN :++&#"
+ c.receive_line "JOIN !te&t"
+ assert_sent_to c, ":sam!sam@hector.irc JOIN :!te&t"
+ end
+ end
test :"joining a channel twice does nothing" do
authenticated_connection.tap do |c|
|
Allow channel name prefix and more Unicode characters in channel names, as per RFC <I>
|
sstephenson_hector
|
train
|
1f72e08636c891a34326bab21a3573e5ced00a2a
|
diff --git a/src/Joomlatools/Console/Command/Site/Configure.php b/src/Joomlatools/Console/Command/Site/Configure.php
index <HASH>..<HASH> 100644
--- a/src/Joomlatools/Console/Command/Site/Configure.php
+++ b/src/Joomlatools/Console/Command/Site/Configure.php
@@ -157,7 +157,7 @@ class Configure extends AbstractDatabase
$remove('root_user', $contents);
file_put_contents($target, $contents);
- chmod($target, 0644);
+ chmod($target, 0664);
if (file_exists($this->target_dir.'/installation')) {
`mv $this->target_dir/installation $this->target_dir/_installation`;
|
Change configuration.php permissions after creation
|
joomlatools_joomlatools-console
|
train
|
17d26e57d729184128224d4b445ba2259534ba05
|
diff --git a/pysoa/common/settings.py b/pysoa/common/settings.py
index <HASH>..<HASH> 100644
--- a/pysoa/common/settings.py
+++ b/pysoa/common/settings.py
@@ -140,6 +140,9 @@ class Settings(object):
def __getitem__(self, key):
return self._data[key]
+ def __contains__(self, key):
+ return key in self._data
+
class SOASettings(Settings):
"""
|
Support `in` keyword for SOA settings
|
eventbrite_pysoa
|
train
|
2c20a47bdd323fa5b096d96ae998d3e5b1ce110d
|
diff --git a/lib/fileInfo/fileInfoNode.js b/lib/fileInfo/fileInfoNode.js
index <HASH>..<HASH> 100644
--- a/lib/fileInfo/fileInfoNode.js
+++ b/lib/fileInfo/fileInfoNode.js
@@ -17,7 +17,12 @@ var FileInfoNode = module.exports = (function() {
filename : '',
treename : '',
dependencryArr : [],
- type : '', // css|js
+
+ // .css | .js | .less | .mustache | .html | etc.etc.
+ type : '',
+
+ // template | stylesheet | javascript
+ typegeneric : '',
getFullPath : function (p) {
return p
@@ -69,6 +74,7 @@ var FileInfoNode = module.exports = (function() {
getFileUtility : function () {
var type = this.type;
+
if (type.match(/\.js/)) {
return UtilityJS;
} else if (type.match(/\.css|\.less/)) {
|
template files associating with certain extensions are not concatenated during builds with active compress
|
iambumblehead_scroungejs
|
train
|
d3c1b2c6c0d2536eae7a2097b280704ce43ec86a
|
diff --git a/services/datalad/datalad_service/handlers/files.py b/services/datalad/datalad_service/handlers/files.py
index <HASH>..<HASH> 100644
--- a/services/datalad/datalad_service/handlers/files.py
+++ b/services/datalad/datalad_service/handlers/files.py
@@ -113,7 +113,8 @@ class FilesResource(object):
files_to_delete = []
dirs_to_delete = []
paths_not_found = []
- filenames = req.media['filenames']
+ filenames = [filename.replace(':', '/')
+ for filename in req.media['filenames']]
for filename in filenames:
file_path = os.path.join(ds_path, filename)
if os.path.exists(file_path):
diff --git a/services/datalad/tests/test_files.py b/services/datalad/tests/test_files.py
index <HASH>..<HASH> 100644
--- a/services/datalad/tests/test_files.py
+++ b/services/datalad/tests/test_files.py
@@ -249,16 +249,31 @@ def test_delete_file(client, new_dataset):
response = client.simulate_delete('/datasets/{}/files'.format(
ds_id), body='{ "filenames": ["dataset_description.json", "CHANGES"] }')
assert response.status == falcon.HTTP_OK
- print(response.content)
assert json.loads(response.content)['deleted'] == [
'dataset_description.json', 'CHANGES']
+def test_delete_nested_file(client, new_dataset):
+ ds_id = os.path.basename(new_dataset.path)
+ response = client.simulate_post(
+ '/datasets/{}/files/derivatives:LICENSE'.format(ds_id), body='GPL V3.0')
+ assert response.status == falcon.HTTP_OK
+ # Commit new nested file
+ response = client.simulate_post(
+ '/datasets/{}/draft'.format(ds_id), params={"validate": "false"})
+ assert response.status == falcon.HTTP_OK
+ # Delete new nested file + an existing file
+ response = client.simulate_delete('/datasets/{}/files'.format(
+ ds_id), body='{ "filenames": ["derivatives:LICENSE", "CHANGES"] }')
+ assert response.status == falcon.HTTP_OK
+ assert json.loads(response.content)['deleted'] == [
+ 'derivatives/LICENSE', 'CHANGES']
+
+
def test_delete_non_existing_file(client, new_dataset):
ds_id = os.path.basename(new_dataset.path)
response = client.simulate_delete(
'/datasets/{}/files'.format(ds_id), body='{ "filenames": ["fake", "test"]}')
assert response.status == falcon.HTTP_OK
- print(response.content)
assert json.loads(response.content)[
'error'] == 'the following files not found: fake, test'
|
fix: Support both accepted formats for bulk delete filenames
|
OpenNeuroOrg_openneuro
|
train
|
02c38dcda7cc43cbe61766931e89fad1acf9eefd
|
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
@@ -281,11 +281,42 @@ func (d *Driver) Create() error {
log.Debugf("Adding key to authorized-keys.d...")
- if err := drivers.AddPublicKeyToAuthorizedHosts(d, "/root/.docker/authorized-keys.d"); err != nil {
+ cmd, err := d.GetSSHCommand("sudo mkdir -p /var/lib/boot2docker/.docker && sudo chown -R docker /var/lib/boot2docker/.docker")
+ if err != nil {
+ return err
+ }
+ if err := cmd.Run(); err != nil {
+ return err
+ }
+
+ if err := drivers.AddPublicKeyToAuthorizedHosts(d, "/var/lib/boot2docker/.docker/authorized-keys.d"); err != nil {
+ return err
+ }
+
+ // HACK: configure docker to use persisted auth
+ cmd, err = d.GetSSHCommand("echo DOCKER_TLS=no | sudo tee -a /var/lib/boot2docker/profile")
+ if err != nil {
+ return err
+ }
+ if err := cmd.Run(); err != nil {
+ return err
+ }
+
+ extraArgs := `EXTRA_ARGS='--auth=identity
+ --auth-authorized-dir=/var/lib/boot2docker/.docker/authorized-keys.d
+ --auth-known-hosts=/var/lib/boot2docker/.docker/known-hosts.json
+ --identity=/var/lib/boot2docker/.docker/key.json
+ -H tcp://0.0.0.0:2376'`
+ sshCmd := fmt.Sprintf("echo \"%s\" | sudo tee -a /var/lib/boot2docker/profile", extraArgs)
+ cmd, err = d.GetSSHCommand(sshCmd)
+ if err != nil {
+ return err
+ }
+ if err := cmd.Run(); err != nil {
return err
}
- cmd, err := d.GetSSHCommand("sudo /etc/init.d/docker restart")
+ cmd, err = d.GetSSHCommand("sudo /etc/init.d/docker restart")
if err != nil {
return err
}
|
fixes #<I>: persist identity keys in b2d
|
docker_machine
|
train
|
2b2f4aafccf24d81e681db49078afab7e9225d4b
|
diff --git a/tests/functional-test.js b/tests/functional-test.js
index <HASH>..<HASH> 100644
--- a/tests/functional-test.js
+++ b/tests/functional-test.js
@@ -62,7 +62,7 @@ describe('Functional test suite for Broccoli Leasot', () => {
fileTree = null;
});
- it('Basic setup', () => {
+ it('Basic setup', (done) => {
setupFixtureTree();
broccoliLeasot = new BroccoliLeasotFilter(fileTree, {
enabled: true,
@@ -75,12 +75,13 @@ describe('Functional test suite for Broccoli Leasot', () => {
fixtures.cssMarkers.forEach(checkWithMarkerForGroupByFile);
fixtures.hbsMarkers.forEach(checkWithMarkerForGroupByFile);
expect(message).to.include('9 markers found');
+ done();
});
});
- it('Group by type', () => {
+ it('Group by type', (done) => {
setupFixtureTree();
broccoliLeasot = new BroccoliLeasotFilter(fileTree, {
enabled: true,
@@ -93,11 +94,12 @@ describe('Functional test suite for Broccoli Leasot', () => {
fixtures.jsMarkers.forEach(checkWithMarkerForGroupByKind);
fixtures.cssMarkers.forEach(checkWithMarkerForGroupByKind);
fixtures.hbsMarkers.forEach(checkWithMarkerForGroupByKind);
+ done();
});
});
- it('Imaginary extension lookup', () => {
+ it('Imaginary extension lookup', (done) => {
setupFixtureTree(true);
broccoliLeasot = new BroccoliLeasotFilter(fileTree, {
enabled: true,
@@ -108,7 +110,8 @@ describe('Functional test suite for Broccoli Leasot', () => {
return outputTree.build().then(function() {
let linkToLeasotDocs = 'https://github.com/pgilad/leasot#supported-languages';
expect(message).to.include(linkToLeasotDocs);
+ done();
});
});
-});
\ No newline at end of file
+});
|
Let mocha know that promise is resolved
Mocha needs to know that an async operation is over so that it
can stop waiting on a test. This is made possible through a done()
callback. Added it so that we're on standards and make AppVeyor
happy about it.
|
sivakumar-kailasam_broccoli-leasot
|
train
|
c4fec7711ae7832d773b3f0f4f9c2440df67bc63
|
diff --git a/src/SnooPHP/Http/Response.php b/src/SnooPHP/Http/Response.php
index <HASH>..<HASH> 100644
--- a/src/SnooPHP/Http/Response.php
+++ b/src/SnooPHP/Http/Response.php
@@ -154,6 +154,7 @@ class Response
*/
public static function json($content)
{
+ if (is_a($content, "SnooPHP\Model\Collection")) $content = $content->array();
return new static(
to_json($content),
200, [
diff --git a/src/SnooPHP/Model/Collection.php b/src/SnooPHP/Model/Collection.php
index <HASH>..<HASH> 100644
--- a/src/SnooPHP/Model/Collection.php
+++ b/src/SnooPHP/Model/Collection.php
@@ -162,6 +162,21 @@ class Collection
}
/**
+ * Expands nodes within this collection
+ *
+ * @param string|array $edges edges to expand
+ * @param bool $force assumes all models are nodes
+ *
+ * @return Collection return this collection
+ */
+ public function expand($edges = [], $force = true)
+ {
+ if ($force) foreach ($this->models as $i => $model) $this->models[$i]->expand($edges);
+ else foreach ($this->models as $i => $model) if (is_a($model, "SnooPHP\Model\Node")) $this->models[$i]->expand($edges);
+ return $this;
+ }
+
+ /**
* Append another collection
*
* @param Collection $collection collection to append
diff --git a/src/SnooPHP/Model/Model.php b/src/SnooPHP/Model/Model.php
index <HASH>..<HASH> 100644
--- a/src/SnooPHP/Model/Model.php
+++ b/src/SnooPHP/Model/Model.php
@@ -225,7 +225,7 @@ class Model
// Populate model
$refModel = new $refClass;
- foreach ($row as $column => $val) $refModel->$column = $refModel->decodeValue($val);
+ foreach ($row as $column => $val) $refModel->$column = $refModel->decodeValue($val, $column);
return $refModel;
}
diff --git a/src/SnooPHP/helpers.php b/src/SnooPHP/helpers.php
index <HASH>..<HASH> 100644
--- a/src/SnooPHP/helpers.php
+++ b/src/SnooPHP/helpers.php
@@ -50,6 +50,28 @@ if (!function_exists("path"))
}
}
+if (!function_exists("read_file"))
+{
+ /**
+ * Return content from file
+ *
+ * It is really just an alias for @see file_get_contents()
+ *
+ * @param string $path path to file
+ *
+ * @return string|bool false if fails
+ */
+ function read_file($path)
+ {
+ // Calc real path
+ $path = ltrim($path);
+ if ($path[0] === '/') $path = rtrim($path);
+ else $path = path($path);
+
+ return file_get_contents($path);
+ }
+}
+
if (!function_exists("to_json"))
{
/**
@@ -121,4 +143,38 @@ if (!function_exists("unescape_unicode"))
{
return preg_replace("/\\\\\\\\u/", "\\\\u", $content);
}
+}
+
+if (!function_exists("write_file"))
+{
+ /**
+ * Put content to file using put_content native php function
+ *
+ * @param string $path path to file
+ * @param mixed $content string, binary or object/array content (converted to json)
+ * @param bool $createDir if directories don't exist create them
+ * @param bool $serialize if true, objects and arrays will be serialized rather than converted to json
+ *
+ * @return bool false if fails
+ */
+ function write_file($path, $content, $createDir = true, $serialize = false)
+ {
+ // Calc real path
+ $path = ltrim($path);
+ if ($path[0] === '/') $path = rtrim($path);
+ else $path = path($path);
+
+ // Check if dir exists
+ // Create it otherwise
+ $dir = dirname($path);
+ if (!file_exists($dir) && (!$createDir || !mkdir($dir, 0755, true))) return false;
+
+ // Convert content
+ $content = is_string($content) ? $content : (
+ $serialize ? serialize($content) : to_json($content)
+ );
+
+ // Write file
+ return file_put_contents($path, $content) !== false;
+ }
}
\ No newline at end of file
|
Fixed multiple issues + read file utility function
* Fixed error with Model::belongsTo method
* Added support for collection in Response::json method
* Added Collection::expand method to avoid using each()
|
snoophp_framework
|
train
|
639ddda89dd3d9466b6e9e68a7ebdb06f1fe6700
|
diff --git a/src/Illuminate/Routing/Redirector.php b/src/Illuminate/Routing/Redirector.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Routing/Redirector.php
+++ b/src/Illuminate/Routing/Redirector.php
@@ -9,7 +9,7 @@ use Illuminate\Session\Store as SessionStore;
class Redirector
{
use Macroable;
-
+
/**
* The URL generator instance.
*
|
Apply fixes from StyleCI (#<I>)
|
laravel_framework
|
train
|
3c628b8ee5afe0f42ba9273623268310946608ef
|
diff --git a/src/test/java/io/nats/client/EncodedConnectionTest.java b/src/test/java/io/nats/client/EncodedConnectionTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/io/nats/client/EncodedConnectionTest.java
+++ b/src/test/java/io/nats/client/EncodedConnectionTest.java
@@ -70,7 +70,6 @@ public class EncodedConnectionTest {
Connection c = mock(Connection.class);
EncodedConnection ec = new EncodedConnection(c, DEFAULT_ENCODER);
- fail("Not yet implemented"); // TODO
}
}
|
Removed bogus test fail.
|
nats-io_java-nats
|
train
|
20efad8948c2c8cd2c69622aa060af0317586ea2
|
diff --git a/graylog2-web-interface/src/logic/rest/FetchProvider.js b/graylog2-web-interface/src/logic/rest/FetchProvider.js
index <HASH>..<HASH> 100644
--- a/graylog2-web-interface/src/logic/rest/FetchProvider.js
+++ b/graylog2-web-interface/src/logic/rest/FetchProvider.js
@@ -10,6 +10,20 @@ import { createUnauthorizedError } from 'logic/errors/ReportedErrors';
import Routes from 'routing/Routes';
import history from 'util/History';
+export const logoutIfUnauthorized = (error, SessionStore) => {
+ if (SessionStore.isLoggedIn() && error.status === 401) {
+ const SessionActions = ActionsProvider.getActions('Session');
+ SessionActions.logout(SessionStore.getSessionId());
+ }
+};
+
+export const redirectIfForbidden = (error, SessionStore) => {
+ // Redirect to the start page if a user is logged in but not allowed to access a certain HTTP API.
+ if (SessionStore.isLoggedIn() && error.status === 403) {
+ history.replace(Routes.NOTFOUND);
+ }
+};
+
export class FetchError extends Error {
constructor(message, additional) {
super(message);
@@ -56,7 +70,7 @@ export class Builder {
return this;
}
- json(body) {
+ json(body, handleForbidden = redirectIfForbidden, handleUnauthorized = logoutIfUnauthorized) {
this.request = this.request
.send(body)
.type('json')
@@ -67,19 +81,13 @@ export class Builder {
ServerAvailabilityActions.reportSuccess();
return resp.body;
}
-
throw new FetchError(resp.statusText, resp);
}, (error) => {
const SessionStore = StoreProvider.getStore('Session');
- if (SessionStore.isLoggedIn() && error.status === 401) {
- const SessionActions = ActionsProvider.getActions('Session');
- SessionActions.logout(SessionStore.getSessionId());
- }
// Redirect to the start page if a user is logged in but not allowed to access a certain HTTP API.
- if (SessionStore.isLoggedIn() && error.status === 403) {
- ErrorsActions.report(createUnauthorizedError(error));
- }
+ handleForbidden(error, SessionStore);
+ handleUnauthorized(error, SessionStore);]
if (error.originalError && !error.originalError.status) {
const ServerAvailabilityActions = ActionsProvider.getActions('ServerAvailability');
@@ -154,10 +162,11 @@ function queuePromiseIfNotLoggedin(promise) {
return promise;
}
-export default function fetch(method, url, body) {
+export default function fetch(method, url, body, handleForbidden, handleUnauthorized) {
+ console.log(handleForbidden, handleUnauthorized);
const promise = () => new Builder(method, url)
.authenticated()
- .json(body)
+ .json(body, handleForbidden, handleUnauthorized)
.build();
return queuePromiseIfNotLoggedin(promise)();
|
Allow customization of FetchProvider unauthorized and forbidden request hadnling
|
Graylog2_graylog2-server
|
train
|
153c7fd3bcdba7efd83505840173df791a2e6cc7
|
diff --git a/lib/ronin/cacheable.rb b/lib/ronin/cacheable.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/cacheable.rb
+++ b/lib/ronin/cacheable.rb
@@ -41,6 +41,8 @@ module Ronin
obj = self.load_context(path)
obj.cached_path = path
+ obj.cached_timestamp = File.mtime(path)
+
obj.prepare_cache
return obj
end
@@ -49,10 +51,7 @@ module Ronin
path = File.expand_path(path)
self.all(:cached_path => path).destroy!
-
- obj = self.load_context(path)
- obj.cached_path = path
- return obj.cache!
+ return self.load(path).save!
end
end
end
@@ -67,17 +66,6 @@ module Ronin
return self
end
- def cache!
- if self.cached_path
- self.cached_timestamp = File.mtime(self.cached_path)
-
- prepare_cache
- return save!
- end
-
- return false
- end
-
def sync!
if (self.cached_path && self.cached_timestamp)
if File.file?(self.cached_path)
|
Moved cache! logic into self.cache.
|
ronin-ruby_ronin
|
train
|
e46420e595edaf2c3eae5c220e3864fb01a03f09
|
diff --git a/src/core/core.scale.js b/src/core/core.scale.js
index <HASH>..<HASH> 100644
--- a/src/core/core.scale.js
+++ b/src/core/core.scale.js
@@ -726,7 +726,7 @@ export default class Scale extends Element {
}
// Don't bother fitting the ticks if we are not showing the labels
- if (tickOpts.display && display) {
+ if (tickOpts.display && display && me.ticks.length) {
const labelSizes = me._getLabelSizes();
const firstLabelSize = labelSizes.first;
const lastLabelSize = labelSizes.last;
|
Cleaner handling of fitting no ticks (#<I>)
|
chartjs_Chart.js
|
train
|
37780f66f0070c165d5394f6947070fb83a1fb82
|
diff --git a/lib/moped/bson/binary.rb b/lib/moped/bson/binary.rb
index <HASH>..<HASH> 100644
--- a/lib/moped/bson/binary.rb
+++ b/lib/moped/bson/binary.rb
@@ -63,6 +63,14 @@ module Moped
"#<#{self.class.name} type=#{type.inspect} length=#{data.bytesize}>"
end
+ def to_s
+ data.to_s
+ end
+
+ def to_s
+ data.to_s
+ end
+
end
end
end
diff --git a/lib/moped/bson/object_id.rb b/lib/moped/bson/object_id.rb
index <HASH>..<HASH> 100644
--- a/lib/moped/bson/object_id.rb
+++ b/lib/moped/bson/object_id.rb
@@ -52,6 +52,10 @@ module Moped
@@string_format % data.unpack("C12")
end
+ def inspect
+ to_s.inspect
+ end
+
def to_json(*args)
"{\"$oid\": \"#{to_s}\"}"
end
diff --git a/spec/moped/bson/object_id_spec.rb b/spec/moped/bson/object_id_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/moped/bson/object_id_spec.rb
+++ b/spec/moped/bson/object_id_spec.rb
@@ -159,6 +159,14 @@ describe Moped::BSON::ObjectId do
end
+ describe "#inspect" do
+
+ it "returns a sane representation of the id" do
+ Moped::BSON::ObjectId.from_data(bytes).inspect.should eq '"4e4d66343b39b68407000001"'
+ end
+
+ end
+
describe "#to_json" do
it "returns a json representation of the id" do
|
Binary#to_s is sane.
- ObjectId#inspect is sane.
|
mongoid_moped
|
train
|
8215edb5b41dab2a7cf890ac5716a88355043b01
|
diff --git a/src/fold.js b/src/fold.js
index <HASH>..<HASH> 100644
--- a/src/fold.js
+++ b/src/fold.js
@@ -171,50 +171,6 @@ class Fold{
/**
- * Ensure the fold's elements have unique ID attributes.
- *
- * If no ID attributes are present, or they conflict with another DOM element's
- * identifier, new IDs are generated for each element (randomly if needed).
- *
- * Internal-use only, called from instance's constructor.
- *
- * @private
- */
- checkIDs(){
- const headingSuffix = "-heading";
- const contentSuffix = "-content";
- let elID = this.el.id;
- let heading = this.heading;
- let content = this.content;
- let id;
-
- /** Neither of the fold's elements have an ID attribute */
- if(!heading.id && !content.id){
- id = elID || uniqueID("a");
- heading.id = id + headingSuffix;
- content.id = id + contentSuffix;
- }
-
- /** Either the heading or element lack an ID */
- else if(!content.id) content.id = (elID || heading.id) + contentSuffix;
- else if(!heading.id) heading.id = (elID || content.id) + headingSuffix;
-
- /** Finally, double-check each element's ID is really unique */
- const $ = s => document.querySelectorAll("#"+s);
- while($(content.id).length > 1 || $(heading.id).length > 1){
- id = uniqueID("a");
- content.id = id + contentSuffix;
- heading.id = id + headingSuffix;
- }
-
- /** Update ARIA attributes */
- heading.setAttribute("aria-controls", content.id);
- content.setAttribute("aria-labelledby", heading.id);
- }
-
-
-
- /**
* Adjust a fold's container to fit its content.
*/
fit(){
@@ -243,7 +199,37 @@ class Fold{
if(input){
heading.setAttribute("role", "tab");
content.setAttribute("role", "tabpanel");
- this.checkIDs();
+
+
+ /** Ensure the fold's elements have unique ID attributes. */
+ const headingSuffix = "-heading";
+ const contentSuffix = "-content";
+ let elID = this.el.id;
+ let id;
+
+ /** Neither of the fold's elements have an ID attribute */
+ if(!heading.id && !content.id){
+ id = elID || uniqueID("a");
+ heading.id = id + headingSuffix;
+ content.id = id + contentSuffix;
+ }
+
+ /** Either the heading or element lack an ID */
+ else if(!content.id) content.id = (elID || heading.id) + contentSuffix;
+ else if(!heading.id) heading.id = (elID || content.id) + headingSuffix;
+
+ /** Finally, double-check each element's ID is really unique */
+ const $ = s => document.querySelectorAll("#"+s);
+ while($(content.id).length > 1 || $(heading.id).length > 1){
+ id = uniqueID("a");
+ content.id = id + contentSuffix;
+ heading.id = id + headingSuffix;
+ }
+
+ /** Update ARIA attributes */
+ heading.setAttribute("aria-controls", content.id);
+ content.setAttribute("aria-labelledby", heading.id);
+
/** Update the attributes that're controlled by .open's setter */
heading.setAttribute("aria-selected", this._open);
|
Inline logic of the Fold.checkIDs method
This is only called once, from the same property setter. It doesn't need
its own class method, and having it inlined the same way the ES5 version
has might make it slightly easier to synchronise updates between the two
files.
|
Alhadis_Accordion
|
train
|
a53787abf5b9442f6b3eb25fc915cc95888a65e1
|
diff --git a/benchmarks/bench-insert-select.js b/benchmarks/bench-insert-select.js
index <HASH>..<HASH> 100644
--- a/benchmarks/bench-insert-select.js
+++ b/benchmarks/bench-insert-select.js
@@ -14,6 +14,7 @@ connection.query([
function benchmarkInsert(numLeft, callback) {
connection.query('INSERT INTO ' + table + ' SET title="' + text + '"', function(err, result) {
+ debugger;
if (err) throw err;
if (numLeft > 1)
benchmarkInsert(numLeft-1, callback);
@@ -69,9 +70,14 @@ module.exports = function(done) {
var testEnd = process.hrtime();
console.log('total time: ', common.hrdiff(testStart, testEnd)/1e9 );
connection.end();
- done();
+ if (done)
+ done();
});
});
});
});
};
+
+if (require.main === module) {
+ module.exports();
+}
|
run benchmarks when not require'd
|
sidorares_node-mysql2
|
train
|
3024ea39be52adccff9c5c03b0431757c4c20aa2
|
diff --git a/src/main/java/com/greenlaw110/rythm/internal/parser/build_in/ExpressionParser.java b/src/main/java/com/greenlaw110/rythm/internal/parser/build_in/ExpressionParser.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/greenlaw110/rythm/internal/parser/build_in/ExpressionParser.java
+++ b/src/main/java/com/greenlaw110/rythm/internal/parser/build_in/ExpressionParser.java
@@ -122,7 +122,7 @@ public class ExpressionParser extends CaretParserFactoryBase {
}
protected String patternStr() {
- return "^(%s[0-9a-zA-Z_][a-zA-Z0-9_\\.]*((\\.[a-zA-Z][a-zA-Z0-9_\\.]*)*(?@[])*(?@())*)((\\.[a-zA-Z][a-zA-Z0-9_\\.]*)*(?@[])*(?@())*)*)*";
+ return "^(%s[a-zA-Z_][a-zA-Z0-9_\\.]*((\\.[a-zA-Z][a-zA-Z0-9_\\.]*)*(?@[])*(?@())*)((\\.[a-zA-Z][a-zA-Z0-9_\\.]*)*(?@[])*(?@())*)*)*";
}
public static void main(String[] args) {
|
revert an in correct change in ExperssionParser
|
rythmengine_rythmengine
|
train
|
73de75f1f538d668585f958e949cf38428644998
|
diff --git a/tests/Unit/CachedBuilderTest.php b/tests/Unit/CachedBuilderTest.php
index <HASH>..<HASH> 100644
--- a/tests/Unit/CachedBuilderTest.php
+++ b/tests/Unit/CachedBuilderTest.php
@@ -500,7 +500,18 @@ class CachedBuilderTest extends TestCase
public function testRawWhereClauseParsing()
{
- // ->whereRaw(...)
- $this->markTestIncomplete();
+ $authors = collect([(new Author)
+ ->whereRaw('name <> \'\'')->first()]);
+
+ $key = 'genealabslaravelmodelcachingtestsfixturesauthor_and_name-first';
+ $tags = ['genealabslaravelmodelcachingtestsfixturesauthor'];
+
+ $cachedResults = collect([cache()->tags($tags)->get($key)]);
+
+ $liveResults = collect([(new UncachedAuthor)
+ ->whereRaw('name <> \'\'')->first()]);
+
+ $this->assertTrue($authors->diffAssoc($cachedResults)->isEmpty());
+ $this->assertTrue($liveResults->diffAssoc($cachedResults)->isEmpty());
}
}
|
Add unit test for raw where clause parsing
|
GeneaLabs_laravel-model-caching
|
train
|
fd3ba425c333c3921bae9f2c1e9b40a9d550e8e4
|
diff --git a/google-cloud-asset-v1/lib/google/cloud/asset/v1/asset_service/client.rb b/google-cloud-asset-v1/lib/google/cloud/asset/v1/asset_service/client.rb
index <HASH>..<HASH> 100644
--- a/google-cloud-asset-v1/lib/google/cloud/asset/v1/asset_service/client.rb
+++ b/google-cloud-asset-v1/lib/google/cloud/asset/v1/asset_service/client.rb
@@ -1088,7 +1088,7 @@ module Google
config_attr :endpoint, "cloudasset.googleapis.com", ::String
config_attr :credentials, nil do |value|
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
allowed.any? { |klass| klass === value }
end
diff --git a/google-cloud-asset-v1/lib/google/cloud/asset/v1/asset_service/operations.rb b/google-cloud-asset-v1/lib/google/cloud/asset/v1/asset_service/operations.rb
index <HASH>..<HASH> 100644
--- a/google-cloud-asset-v1/lib/google/cloud/asset/v1/asset_service/operations.rb
+++ b/google-cloud-asset-v1/lib/google/cloud/asset/v1/asset_service/operations.rb
@@ -475,7 +475,7 @@ module Google
config_attr :endpoint, "cloudasset.googleapis.com", ::String
config_attr :credentials, nil do |value|
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
allowed.any? { |klass| klass === value }
end
diff --git a/google-cloud-asset-v1/synth.metadata b/google-cloud-asset-v1/synth.metadata
index <HASH>..<HASH> 100644
--- a/google-cloud-asset-v1/synth.metadata
+++ b/google-cloud-asset-v1/synth.metadata
@@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/google-cloud-ruby.git",
- "sha": "0a5e127f4c043a5f1f5e320e2bf1c465d872514e"
+ "sha": "89560ed803d9dec006c77ed1206441b9c51f6909"
}
},
{
|
fix(asset-v1): Allow special symbolic credentials in client configs
|
googleapis_google-cloud-ruby
|
train
|
8fbb3867a41f5044ddfec20d369b059e2a42c610
|
diff --git a/src/Zicht/Bundle/UrlBundle/Aliasing/ProviderDecorator.php b/src/Zicht/Bundle/UrlBundle/Aliasing/ProviderDecorator.php
index <HASH>..<HASH> 100644
--- a/src/Zicht/Bundle/UrlBundle/Aliasing/ProviderDecorator.php
+++ b/src/Zicht/Bundle/UrlBundle/Aliasing/ProviderDecorator.php
@@ -6,7 +6,8 @@
namespace Zicht\Bundle\UrlBundle\Aliasing;
-use Symfony\Component\Security\Core\SecurityContextInterface;
+use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
+use Zicht\Bundle\UrlBundle\Exception\UnsupportedException;
use Zicht\Bundle\UrlBundle\Url\DelegatingProvider;
/**
@@ -56,7 +57,7 @@ class ProviderDecorator extends DelegatingProvider
/**
* @{inheritDoc}
*/
- public function all(SecurityContextInterface $security)
+ public function all(AuthorizationCheckerInterface $security)
{
$urlList = parent::all($security);
diff --git a/src/Zicht/Bundle/UrlBundle/Url/DelegatingProvider.php b/src/Zicht/Bundle/UrlBundle/Url/DelegatingProvider.php
index <HASH>..<HASH> 100644
--- a/src/Zicht/Bundle/UrlBundle/Url/DelegatingProvider.php
+++ b/src/Zicht/Bundle/UrlBundle/Url/DelegatingProvider.php
@@ -6,7 +6,7 @@
namespace Zicht\Bundle\UrlBundle\Url;
-use Symfony\Component\Security\Core\SecurityContextInterface;
+use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Zicht\Bundle\UrlBundle\Exception\UnsupportedException;
use Zicht\Bundle\FrameworkExtraBundle\Util\SortedList;
@@ -89,7 +89,7 @@ class DelegatingProvider implements Provider, SuggestableProvider, ListableProvi
/**
* @{inheritDoc}
*/
- public function all(SecurityContextInterface $securityContext)
+ public function all(AuthorizationCheckerInterface $securityContext)
{
$ret = array();
foreach ($this->providers as $provider) {
diff --git a/src/Zicht/Bundle/UrlBundle/Url/ListableProvider.php b/src/Zicht/Bundle/UrlBundle/Url/ListableProvider.php
index <HASH>..<HASH> 100644
--- a/src/Zicht/Bundle/UrlBundle/Url/ListableProvider.php
+++ b/src/Zicht/Bundle/UrlBundle/Url/ListableProvider.php
@@ -5,7 +5,7 @@
*/
namespace Zicht\Bundle\UrlBundle\Url;
-use Symfony\Component\Security\Core\SecurityContextInterface;
+use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
/**
* Implementing a listable provider will make the url's available on the
@@ -18,8 +18,8 @@ interface ListableProvider
*
* The securitycontext must be passed so it is available for the provider to check access rights.
*
- * @param SecurityContextInterface $securityContextInterface
+ * @param AuthorizationCheckerInterface $securityContextInterface
* @return array
*/
- public function all(SecurityContextInterface $securityContextInterface);
+ public function all(AuthorizationCheckerInterface $securityContextInterface);
}
|
BC break: SecurityContextInterface => AuthorizationChecker
Implementations of the ListableProvider must now use
AuthorizationCheckerInterface in the method `all()` as a first
parameter.
|
zicht_url-bundle
|
train
|
89428ae268d2be5371a50c77d0e21bb5e952db77
|
diff --git a/src/java/org/apache/cassandra/service/StorageProxy.java b/src/java/org/apache/cassandra/service/StorageProxy.java
index <HASH>..<HASH> 100644
--- a/src/java/org/apache/cassandra/service/StorageProxy.java
+++ b/src/java/org/apache/cassandra/service/StorageProxy.java
@@ -1476,7 +1476,7 @@ public class StorageProxy implements StorageProxyMBean
}
else
{
- float resultRowsPerStorageRow = cfs.getMeanColumns() / cfs.metadata.regularColumns().size();
+ float resultRowsPerStorageRow = ((float) cfs.getMeanColumns()) / cfs.metadata.regularColumns().size();
resultRowsPerRange = resultRowsPerStorageRow * (cfs.estimateKeys());
}
}
|
use floating pt math for percentages
|
Stratio_stratio-cassandra
|
train
|
10a6dcd017e77fb376b5dc6d665089832334f94e
|
diff --git a/app/search_builders/curation_concerns/member_search_builder.rb b/app/search_builders/curation_concerns/member_search_builder.rb
index <HASH>..<HASH> 100644
--- a/app/search_builders/curation_concerns/member_search_builder.rb
+++ b/app/search_builders/curation_concerns/member_search_builder.rb
@@ -6,12 +6,16 @@ module CurationConcerns
# Defines which search_params_logic should be used when searching for Collection members
self.default_processor_chain += [:include_collection_ids]
- delegate :collection, to: :scope
-
# include filters into the query to only include the collection memebers
def include_collection_ids(solr_parameters)
solr_parameters[:fq] ||= []
- solr_parameters[:fq] << "{!join from=#{from_field} to=id}id:#{collection.id}"
+ solr_parameters[:fq] << "{!join from=#{from_field} to=id}id:#{collection_id}"
end
+
+ protected
+
+ def collection_id
+ blacklight_params.fetch('id')
+ end
end
end
|
MemberSearchBuilder does not need collection from the scope
The collection id is already passed to the search builder as parameters.
This loosens the coupling between the search builder and the controller.
|
samvera_hyrax
|
train
|
d67aaff74ab8cbb574666a1be44045f47bc80716
|
diff --git a/lib/vagrant/machine/remote.rb b/lib/vagrant/machine/remote.rb
index <HASH>..<HASH> 100644
--- a/lib/vagrant/machine/remote.rb
+++ b/lib/vagrant/machine/remote.rb
@@ -370,8 +370,8 @@ module Vagrant
synced_folder_clients.each do |f|
next if f[:folder][:disabled]
# TODO: get type of synced folder
- impl = "virtualbox"
- sf = Vagrant::Plugin::V2::SyncedFolder.new(f[:plugin])
+ impl = :virtualbox
+ sf = Vagrant::Plugin::V2::SyncedFolder.new(client: f[:plugin])
# Set plugin, guestpath and hostpath from synced folder info
folders[impl] = {f[:folder][:destination] => f[:folder].merge({
plugin: sf,
|
Set the client using keyword for synced folder
|
hashicorp_vagrant
|
train
|
2198ed591fa5ccdfd73b42f471c23c5f2cbc34db
|
diff --git a/saltcloud/clouds/ec2.py b/saltcloud/clouds/ec2.py
index <HASH>..<HASH> 100644
--- a/saltcloud/clouds/ec2.py
+++ b/saltcloud/clouds/ec2.py
@@ -1154,3 +1154,43 @@ def create_volume(kwargs=None, call=None):
data = query(params, return_root=True)
return data
+
+
+def attach_volume(name=None, kwargs=None, instance_id=None, call=None):
+ '''
+ Attach a volume to an instance
+ '''
+ if call != 'action':
+ log.error('The attach_volume action must be called with '
+ '-a or --action.')
+ sys.exit(1)
+
+ if not kwargs:
+ kwargs = {}
+
+ if 'instance_id' in kwargs:
+ instance_id = kwargs['instance_id']
+
+ if name and not instance_id:
+ instances = list_nodes_full()
+ instance_id = instances[name]['instanceId']
+
+ if not name and not instance_id:
+ log.error('Either a name or an instance_id is required.')
+ return False
+
+ if not 'volume_id' in kwargs:
+ log.error('A volume_id is required.')
+ return False
+
+ if not 'device' in kwargs:
+ log.error('A device is required (ex. /dev/sdb1).')
+ return False
+
+ params = {'Action': 'AttachVolume',
+ 'VolumeId': kwargs['volume_id'],
+ 'InstanceId': instance_id,
+ 'Device': kwargs['device']}
+
+ data = query(params, return_root=True)
+ return data
|
Add attach_volume() to ec2
|
saltstack_salt
|
train
|
f21c221cb4d2ca4e813f2c717712b1a7e8b5fcf7
|
diff --git a/indra/sources/indra_db_rest/util.py b/indra/sources/indra_db_rest/util.py
index <HASH>..<HASH> 100644
--- a/indra/sources/indra_db_rest/util.py
+++ b/indra/sources/indra_db_rest/util.py
@@ -64,6 +64,7 @@ def make_db_rest_request(meth, end_point, query_str, data=None, params=None,
method_func = getattr(requests, meth.lower())
while tries > 0:
tries -= 1
+ timeout = timeout if timeout else None
resp = method_func(url_path, headers=headers, data=json_data,
params=params, timeout=timeout)
if resp.status_code == 200:
|
Handle 0 timeouts more gracefully when passed along.
|
sorgerlab_indra
|
train
|
32b3545c837aeb8f6505921cb58f9b80665ccc2e
|
diff --git a/src/Controller/SearchPackageController.php b/src/Controller/SearchPackageController.php
index <HASH>..<HASH> 100644
--- a/src/Controller/SearchPackageController.php
+++ b/src/Controller/SearchPackageController.php
@@ -284,11 +284,11 @@ class SearchPackageController extends AbstractController
/**
* Create a repository search instance.
*
- * @param string $keywords The search keywords.
+ * @param string $keywords The search keywords.
*
- * @param string $type The desired search type.
+ * @param string $type The desired search type.
*
- * @param Composer $composer The composer instance.
+ * @param Composer $composer The composer instance.
*
* @return CompositeSearch
*/
|
Fix indention in phpDoc
|
tenside_core-bundle
|
train
|
7c6e83334bdab6f8ebf8eca642ae69fbae1534eb
|
diff --git a/lib/brainstem/api_docs/formatters/open_api_specification/endpoint_formatter.rb b/lib/brainstem/api_docs/formatters/open_api_specification/endpoint_formatter.rb
index <HASH>..<HASH> 100644
--- a/lib/brainstem/api_docs/formatters/open_api_specification/endpoint_formatter.rb
+++ b/lib/brainstem/api_docs/formatters/open_api_specification/endpoint_formatter.rb
@@ -50,6 +50,24 @@ module Brainstem
delegate :controller => :endpoint
+ ################################################################################
+ # Methods to override
+ ################################################################################
+
+ #
+ # Format the endpoint summary
+ #
+ def summary
+ endpoint.title
+ end
+
+ #
+ # Format the endpoint description
+ #
+ def description
+ endpoint.description
+ end
+
#
# Formats the actual URI
#
@@ -59,12 +77,16 @@ module Brainstem
.gsub(/(:(?<param>\w+))/, '{\k<param>}')
end
+ ################################################################################
+ # Avoid overridding
+ ################################################################################
+
#
# Formats the summary as given, falling back to the humanized action
# name.
#
def format_summary!
- output[endpoint_key][http_method].merge! summary: endpoint.title.to_s.strip
+ output[endpoint_key][http_method].merge! summary: summary.to_s.strip
end
#
@@ -72,12 +94,12 @@ module Brainstem
#
# TODO: Maybe add recursive / legacy to the description
def format_description!
- return if endpoint.description.blank?
+ return if description.blank?
- description = endpoint.description.to_s.strip
- description += "." unless description =~ /\.\s*\z/
+ desc = description.to_s.strip
+ desc += "." unless desc =~ /\.\s*\z/
- output[endpoint_key][http_method].merge! description: description
+ output[endpoint_key][http_method].merge! description: desc
end
#
|
Update Open Api Specification Endpoint formatter to have overridable methods
|
mavenlink_brainstem
|
train
|
2f68f35424dbf94141cd3bf139569227c40e99a7
|
diff --git a/includes/class-freemius.php b/includes/class-freemius.php
index <HASH>..<HASH> 100755
--- a/includes/class-freemius.php
+++ b/includes/class-freemius.php
@@ -22573,6 +22573,11 @@
return false;
}
+ if ( $this->is_activation_page() ) {
+ // Don't include tabs in the activation page.
+ return false;
+ }
+
if ( $this->is_admin_page( 'pricing' ) && fs_request_get_bool( 'checkout' ) ) {
// Don't add tabs on checkout page, we want to reduce distractions
// as much as possible.
|
[tabs] Don't include tabs when viewing the activation page.
|
Freemius_wordpress-sdk
|
train
|
54416ec12cd192bfbc6c1c3b8a34135e49767cf6
|
diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py
index <HASH>..<HASH> 100644
--- a/spyder/app/mainwindow.py
+++ b/spyder/app/mainwindow.py
@@ -3258,23 +3258,27 @@ class MainWindow(QMainWindow):
if shortcut_sequence:
keyseq = QKeySequence(shortcut_sequence)
- try:
- if isinstance(qobject, QAction):
- if (sys.platform == 'darwin'
- and qobject._shown_shortcut == 'missing'):
- qobject._shown_shortcut = keyseq
- else:
- qobject.setShortcut(keyseq)
+ else:
+ # Needed to remove old sequences that were cleared.
+ # See spyder-ide/spyder#12992
+ keyseq = QKeySequence()
+ try:
+ if isinstance(qobject, QAction):
+ if (sys.platform == 'darwin'
+ and qobject._shown_shortcut == 'missing'):
+ qobject._shown_shortcut = keyseq
+ else:
+ qobject.setShortcut(keyseq)
- if add_shortcut_to_tip:
- add_shortcut_to_tooltip(qobject, context, name)
+ if add_shortcut_to_tip:
+ add_shortcut_to_tooltip(qobject, context, name)
- elif isinstance(qobject, QShortcut):
- qobject.setKey(keyseq)
+ elif isinstance(qobject, QShortcut):
+ qobject.setKey(keyseq)
- except RuntimeError:
- # Object has been deleted
- toberemoved.append(index)
+ except RuntimeError:
+ # Object has been deleted
+ toberemoved.append(index)
for index in sorted(toberemoved, reverse=True):
self.shortcut_data.pop(index)
|
Shortcuts: Clear old setted shortcuts if they are now empty
|
spyder-ide_spyder
|
train
|
a0a5705fd83a58b02411c458d6f9671a6e5b843a
|
diff --git a/gns3server/server.py b/gns3server/server.py
index <HASH>..<HASH> 100644
--- a/gns3server/server.py
+++ b/gns3server/server.py
@@ -32,6 +32,7 @@ import socket
import tornado.ioloop
import tornado.web
import tornado.autoreload
+import pkg_resources
from pkg_resources import parse_version
from .config import Config
@@ -143,8 +144,12 @@ class Server(object):
router = self._create_zmq_router()
# Add our JSON-RPC Websocket handler to Tornado
self.handlers.extend([(r"/", JSONRPCWebSocket, dict(zmq_router=router))])
+ if hasattr(sys, "frozen"):
+ templates_dir = "templates"
+ else:
+ templates_dir = pkg_resources.resource_filename("gns3server", "templates")
tornado_app = tornado.web.Application(self.handlers,
- template_path=os.path.join(os.path.dirname(__file__), "templates"),
+ template_path=templates_dir,
debug=True) # FIXME: debug mode!
try:
|
Fixes issue with Frozen server and templates directory.
|
GNS3_gns3-server
|
train
|
fe3c79c6cfbe9b92db3ec21fe0576bd25f4cafc0
|
diff --git a/lib/diffy/html_formatter.rb b/lib/diffy/html_formatter.rb
index <HASH>..<HASH> 100644
--- a/lib/diffy/html_formatter.rb
+++ b/lib/diffy/html_formatter.rb
@@ -44,7 +44,9 @@ module Diffy
end
def highlighted_words
- chunks = @diff.each_chunk.to_a
+ chunks = @diff.each_chunk.
+ reject{|c| c == '\ No newline at end of file'"\n"}
+
processed = []
lines = chunks.each_with_index.map do |chunk1, index|
next if processed.include? index
diff --git a/spec/diffy_spec.rb b/spec/diffy_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/diffy_spec.rb
+++ b/spec/diffy_spec.rb
@@ -423,6 +423,21 @@ baz
DIFF
end
end
+
+ it "should do highlighting on the last line when there's no trailing newlines" do
+ s1 = "foo\nbar\nbang"
+ s2 = "foo\nbar\nbangleize"
+ Diffy::Diff.new(s1,s2).to_s(:html).should == <<-DIFF
+<div class="diff">
+ <ul>
+ <li class="unchanged"><span>foo</span></li>
+ <li class="unchanged"><span>bar</span></li>
+ <li class="del"><del>bang</del></li>
+ <li class="ins"><ins>bang<strong>leize</strong></ins></li>
+ </ul>
+</div>
+ DIFF
+ end
end
it "should escape diffed html in html output" do
|
Do inline highlighting on last line when there's no newline at end of file
|
samg_diffy
|
train
|
5487c8110b2fe192bd0859b2ea5b49b7c8a0ba07
|
diff --git a/dallinger/command_line/develop.py b/dallinger/command_line/develop.py
index <HASH>..<HASH> 100644
--- a/dallinger/command_line/develop.py
+++ b/dallinger/command_line/develop.py
@@ -1,5 +1,8 @@
import click
+from six.moves.urllib.parse import urlparse
+from six.moves.urllib.parse import urlunparse
+
from dallinger.command_line.utils import header
from dallinger.command_line.utils import log
from dallinger.command_line.utils import Output
@@ -12,9 +15,23 @@ from dallinger.utils import open_browser
BASE_URL = "http://127.0.0.1:7000/"
+def ad_url(config):
+ return BASE_URL + "ad?generate_tokens=true&recruiter=hotair"
+
+
+def dashboard_url(config):
+ parsed = list(urlparse(BASE_URL + "dashboard/develop"))
+ parsed[1] = "{}:{}@{}".format(
+ config.get("dashboard_user"),
+ config.get("dashboard_password"),
+ parsed[1],
+ )
+ return urlunparse(parsed)
+
+
valid_routes = {
- "ad": "ad?generate_tokens=true&recruiter=hotair",
- "dashboard": "dashboard/develop",
+ "ad": ad_url,
+ "dashboard": dashboard_url,
}
@@ -38,10 +55,9 @@ def browser(route=None):
"""Open one of the supported routes with appropriate path and URL parameters"""
config = get_config()
config.load()
- url_tail = valid_routes.get(route)
- if url_tail is not None:
- url = BASE_URL + valid_routes.get(route)
- open_browser(url)
+ url_factory = valid_routes.get(route)
+ if url_factory is not None:
+ open_browser(url_factory(config))
else:
click.echo(
"Supported routes are:\n\t{}".format("\n\t".join(valid_routes.keys()))
|
Don't require entering dashboard creds if they're in config
|
Dallinger_Dallinger
|
train
|
538ab62dcdd003e952cd991f9af08a4a79e269ef
|
diff --git a/CHANGELOG.md b/CHANGELOG.md
index <HASH>..<HASH> 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,7 @@ CHANGELOG for Sulu
==================
* dev-release/1.5
+ * HOTFIX #3739 [ContentBundle] Added locale to content-teaser query
* HOTFIX #3730 [ContactBundle] Fixed class parameter to load field-descriptor
* HOTFIX #3720 [MediaBundle] Added extension-guesser to fix wrong extensions on download
diff --git a/src/Sulu/Bundle/ContentBundle/Teaser/ContentTeaserProvider.php b/src/Sulu/Bundle/ContentBundle/Teaser/ContentTeaserProvider.php
index <HASH>..<HASH> 100644
--- a/src/Sulu/Bundle/ContentBundle/Teaser/ContentTeaserProvider.php
+++ b/src/Sulu/Bundle/ContentBundle/Teaser/ContentTeaserProvider.php
@@ -60,6 +60,7 @@ class ContentTeaserProvider implements TeaserProviderInterface
$searchResult = $this->searchManager
->createSearch(implode(' OR ', $statements))
->indexes($this->getPageIndexes())
+ ->locale($locale)
->execute();
/** @var QueryHit $item */
diff --git a/src/Sulu/Bundle/ContentBundle/Tests/Unit/Teaser/ContentTeaserProviderTest.php b/src/Sulu/Bundle/ContentBundle/Tests/Unit/Teaser/ContentTeaserProviderTest.php
index <HASH>..<HASH> 100644
--- a/src/Sulu/Bundle/ContentBundle/Tests/Unit/Teaser/ContentTeaserProviderTest.php
+++ b/src/Sulu/Bundle/ContentBundle/Tests/Unit/Teaser/ContentTeaserProviderTest.php
@@ -82,6 +82,7 @@ class ContentTeaserProviderTest extends \PHPUnit_Framework_TestCase
)
)->willReturn($this->search->reveal())->shouldBeCalled();
$this->search->indexes(['page_sulu_io_published'])->willReturn($this->search->reveal())->shouldBeCalled();
+ $this->search->locale('de')->willReturn($this->search->reveal())->shouldBeCalled();
$this->search->execute()->willReturn(
[$this->createQueryHit($ids[0], $data[$ids[0]]), $this->createQueryHit($ids[1], $data[$ids[1]])]
);
|
added locale to content-teaser query (#<I>)
|
sulu_sulu
|
train
|
348df4e2a482d85980dfb810a0ba9417ea026bfd
|
diff --git a/core/lib/refinery/core.rb b/core/lib/refinery/core.rb
index <HASH>..<HASH> 100644
--- a/core/lib/refinery/core.rb
+++ b/core/lib/refinery/core.rb
@@ -24,4 +24,3 @@ require 'decorators'
require 'jquery-rails'
require 'jquery-ui-rails'
require 'sass-rails'
-require 'coffee-rails'
diff --git a/templates/refinery/demo.rb b/templates/refinery/demo.rb
index <HASH>..<HASH> 100644
--- a/templates/refinery/demo.rb
+++ b/templates/refinery/demo.rb
@@ -10,9 +10,6 @@ rescue LoadError
ERROR
end
-if File.read("#{destination_root}/Gemfile") !~ /assets.+coffee-rails/m
- gem "coffee-rails", :group => :assets
-end
append_file 'Gemfile' do
"
diff --git a/templates/refinery/edge.rb b/templates/refinery/edge.rb
index <HASH>..<HASH> 100644
--- a/templates/refinery/edge.rb
+++ b/templates/refinery/edge.rb
@@ -12,10 +12,6 @@ rescue LoadError
ERROR
end
-if File.read("#{destination_root}/Gemfile") !~ /assets.+coffee-rails/m
- gem "coffee-rails", :group => :assets
-end
-
if ENV['REFINERY_PATH']
append_file 'Gemfile' do
"
diff --git a/templates/refinery/installer.rb b/templates/refinery/installer.rb
index <HASH>..<HASH> 100644
--- a/templates/refinery/installer.rb
+++ b/templates/refinery/installer.rb
@@ -11,10 +11,6 @@ rescue LoadError
ERROR
end
-if File.read("#{destination_root}/Gemfile") !~ /assets.+coffee-rails/m
- gem "coffee-rails", :group => :assets
-end
-
append_file 'Gemfile', <<-GEMFILE
# Refinery CMS
|
remove unused coffee-rails that breaks dummy generator
|
refinery_refinerycms
|
train
|
a741ceb4404c12913e9dc7626fb4b3dc4b75e04d
|
diff --git a/master/buildbot/test/unit/steps/test_cmake.py b/master/buildbot/test/unit/steps/test_cmake.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/test/unit/steps/test_cmake.py
+++ b/master/buildbot/test/unit/steps/test_cmake.py
@@ -154,3 +154,7 @@ class TestCMake(TestBuildStepMixin, TestReactorMixin, unittest.TestCase):
self.setup_step(CMake(path=Property(prop)))
self.properties.setProperty(prop, value, source='test')
self.expect_and_run_command(value)
+
+ def test_options_path(self):
+ self.setup_step(CMake(path='some/path', options=('A', 'B')))
+ self.expect_and_run_command('A', 'B', 'some/path')
|
Add unit test for fixing an error in passing CMake options and definitions on the cmake command line.
|
buildbot_buildbot
|
train
|
c6f20ccb1f0ce664ddc17916c522aa5d27a7996c
|
diff --git a/structr-ui/src/main/java/org/structr/web/resource/TokenResource.java b/structr-ui/src/main/java/org/structr/web/resource/TokenResource.java
index <HASH>..<HASH> 100644
--- a/structr-ui/src/main/java/org/structr/web/resource/TokenResource.java
+++ b/structr-ui/src/main/java/org/structr/web/resource/TokenResource.java
@@ -151,11 +151,10 @@ public class TokenResource extends LoginResource {
refreshCookie.setHttpOnly(true);
refreshCookie.setMaxAge(refreshMaxAge * 60);
- if (Settings.ForceHttps.getValue()) {
+ if (Settings.ForceHttps.getValue() || securityContext.getRequest().isSecure()) {
tokenCookie.setSecure(true);
refreshCookie.setSecure(true);
-
}
response.addCookie(tokenCookie);
|
Enhancemant: Sets token cookies in secure mode if request is also made via secure connection.
|
structr_structr
|
train
|
fca34be563290c4971dc14a699bda9f6c6aa3bab
|
diff --git a/functions.php b/functions.php
index <HASH>..<HASH> 100644
--- a/functions.php
+++ b/functions.php
@@ -6,7 +6,7 @@ if (!function_exists('getRootPath')) {
function getRootPath(): string
{
- $dir = $rootDir = __DIR__;
+ $dir = __DIR__;
while (!file_exists($dir . '/composer.lock')) {
$dir = dirname($dir);
}
|
:fire: Remove unused assignment
|
Th3Mouk_OpenAPIGenerator
|
train
|
1dff5f40aaca7c93db365f4aa0f8be7257387494
|
diff --git a/eventsourcing/domain/model/snapshot.py b/eventsourcing/domain/model/snapshot.py
index <HASH>..<HASH> 100644
--- a/eventsourcing/domain/model/snapshot.py
+++ b/eventsourcing/domain/model/snapshot.py
@@ -1,5 +1,4 @@
from eventsourcing.domain.model.events import DomainEvent, publish
-from eventsourcing.domain.model.example import Example
from eventsourcing.infrastructure.stored_events.transcoders import topic_from_domain_class, make_stored_entity_id, \
id_prefix_from_entity
@@ -39,7 +38,7 @@ def take_snapshot(entity, at_event_id):
snapshot = Snapshot(
entity_id=stored_snapshotted_entity_id,
domain_event_id=at_event_id,
- topic=topic_from_domain_class(Example),
+ topic=topic_from_domain_class(entity.__class__),
attrs=entity.__dict__.copy(),
)
publish(snapshot)
|
Proposed fix: The snapshot event uses a hard-coded class instead of the entity's class.
I think this might be a problem. Either that or I don't understand how to use the Snapshot model. :)
|
johnbywater_eventsourcing
|
train
|
cc7d99f48f40c1db1e3f6e4ef29c23eeb3cac68b
|
diff --git a/Configuration/TCA/Overrides/be_users.php b/Configuration/TCA/Overrides/be_users.php
index <HASH>..<HASH> 100644
--- a/Configuration/TCA/Overrides/be_users.php
+++ b/Configuration/TCA/Overrides/be_users.php
@@ -8,17 +8,16 @@ if( !defined( 'TYPO3_MODE' ) ) {
$beUsersSiteFcn = function() {
$list = [['', '']];
- $table = 'mshop_locale_site';
+ $dbname = 'db-locale';
- $conn = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( \TYPO3\CMS\Core\Database\ConnectionPool::class )
- ->getConnectionForTable( $table );
-
- if( !empty( $conn->getSchemaManager()->listTableColumns( $table ) ) )
+ try
{
- $result = $conn->createQueryBuilder()
- ->select( 'siteid', 'label', 'nleft', 'nright' )
- ->from( $table )->orderBy( 'nleft' )
- ->execute();
+ $config = \Aimeos\Aimeos\Base::getConfig();
+ $context = \Aimeos\Aimeos\Base::getContext( $config );
+
+ $db = $context->db();
+ $conn = $db->acquire( $dbname );
+ $result = $conn->create( 'SELECT * FROM "mshop_locale_site" ORDER BY "nleft"' )->execute();
$parents = [];
@@ -37,18 +36,29 @@ $beUsersSiteFcn = function() {
}
};
- while( $row = $result->fetch() ) {
+ while( $row = $result->fetch() )
+ {
$list[] = [$row['label'], $row['siteid']];
if( $row['nright'] - $row['nleft'] > 1 ) {
$fcn( $result, array_merge( $parents, [$row['label']] ), $row['nright'] );
}
}
+
+ $db->release( $conn, $dbname );
+ }
+ catch( \Exception $e )
+ {
+ $db->release( $conn, $dbname );
+
+ $log = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( \TYPO3\CMS\Core\Log\LogManager::class );
+ $log->getLogger( __CLASS__ )->warning( 'Unable to retrive Aimeos sites: ' . $e->getMessage() );
}
return $list;
};
+
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns( 'be_users', [
'siteid' => [
'label' => 'LLL:EXT:aimeos/Resources/Private/Language/admin.xlf:be_users_site.title',
|
Rewritten retrieving sites for backend user select box
|
aimeos_aimeos-typo3
|
train
|
cc550367dd3fe992a809e2e56c196dea0049af0c
|
diff --git a/test/reducers/projectSpec.js b/test/reducers/projectSpec.js
index <HASH>..<HASH> 100644
--- a/test/reducers/projectSpec.js
+++ b/test/reducers/projectSpec.js
@@ -197,4 +197,35 @@ describe('Project reducer: ', () => {
chai.expect(movedNode.position).to.deep.equal(position);
});
});
+
+ describe('Load data from JSON', () => {
+ let store;
+ beforeEach(() => {
+ store = mockStore({});
+ });
+
+ it('should be loaded', () => {
+ const data = {
+ nodes: {
+ 1: {
+ id: 1,
+ },
+ },
+ pins: {
+ 1: {
+ id: 1,
+ nodeId: 1,
+ },
+ },
+ links: {},
+ patches: {},
+ meta: {},
+ nodeTypes: {},
+ };
+
+ store.dispatch(Actions.loadProjectFromJSON(JSON.stringify(data)));
+ const projectState = Selectors.Project.getProject(store.getState());
+ chai.expect(projectState).to.deep.equal(data);
+ });
+ });
});
|
test(load): add test for loading project state from json
|
xodio_xod
|
train
|
7349523b09c983d0dd646987b15d98aac1989187
|
diff --git a/src/DataObject.php b/src/DataObject.php
index <HASH>..<HASH> 100644
--- a/src/DataObject.php
+++ b/src/DataObject.php
@@ -11,7 +11,7 @@ class DataObject
{
/** Separator for keys path elements */
const PS = '/';
-
+
/**#@+
* Magic methods prefixes.
*
@@ -180,7 +180,7 @@ class DataObject
$current = &$current[$key];
}
} else {
- /* this is unexisting path, just interrupt loop */
+ /* this is un-existing path, just interrupt loop */
break;
}
}
@@ -193,7 +193,7 @@ class DataObject
*
* @param string $path
*
- * @return array|null
+ * @return mixed
*/
public function getData($path = null)
{
diff --git a/test/DataObject_Test.php b/test/DataObject_Test.php
index <HASH>..<HASH> 100644
--- a/test/DataObject_Test.php
+++ b/test/DataObject_Test.php
@@ -6,16 +6,6 @@ namespace Flancer32\Lib;
class DataObject_UnitTest extends \PHPUnit_Framework_TestCase
{
- public function test_construct()
- {
- /** === Test Data === */
- $VAL = 'value';
- /** === Mocks === */
- /** === Test itself === */
- $obj = new DataObject($VAL, null);
- $this->assertEquals($VAL, $obj->getData());
- }
-
/**
* @expectedException \Exception
*/
@@ -28,21 +18,14 @@ class DataObject_UnitTest extends \PHPUnit_Framework_TestCase
$obj->callUnknownMethod();
}
- public function test_setData_wo_keys()
+ public function test_construct()
{
/** === Test Data === */
+ $VAL = 'value';
/** === Mocks === */
/** === Test itself === */
- $obj = new DataObject();
- $this->assertEquals(null, $obj->getData());
- $obj->setData(10);
- $this->assertEquals(10, $obj->getData());
- $obj->setData('string');
- $this->assertEquals('string', $obj->getData());
- $obj->setData(['array']);
- $this->assertEquals(['array'], $obj->getData());
- $obj->setData(new DataObject('key', 'value'));
- $this->assertEquals('value', $obj->getData('key'));
+ $obj = new DataObject($VAL, null);
+ $this->assertEquals($VAL, $obj->getData());
}
public function test_setData_key()
@@ -50,6 +33,10 @@ class DataObject_UnitTest extends \PHPUnit_Framework_TestCase
/** === Test Data === */
$KEY = 'key';
/** === Mocks === */
+ $obj = new DataObject(['key' => 'value']);
+ $obj->getData('key'); // 'value'
+
+
/** === Test itself === */
$obj = new DataObject();
$obj->setData($KEY, 10);
@@ -60,7 +47,8 @@ class DataObject_UnitTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(['array'], $obj->getData($KEY));
/* use DataObject as data */
$obj->setData($KEY, new DataObject('value'));
- $this->assertEquals('value', $obj->getData($KEY));
+ $this->assertInstanceOf(DataObject::class, $obj->getData($KEY));
+ $this->assertEquals('value', $obj->getData($KEY)->getData());
}
public function test_setData_path()
@@ -84,11 +72,33 @@ class DataObject_UnitTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($VAL_INT, $obj->getData('path/to/node'));
$this->assertEquals($VAL_STR1, $obj->getData('/key'));
$this->assertEquals(null, $obj->getData('/path/is/not/exist'));
+ }
+
+ public function test_setData_path_nested()
+ {
+ $obj = new DataObject();
/* use DataObject as data */
$obj->setData('path/to/node', new DataObject('attr', 'value'));
$this->assertEquals('value', $obj->getData('path/to/node/attr'));
+ $this->assertInstanceOf(DataObject::class, $obj->getData('path/to/node'));
}
+ public function test_setData_wo_keys()
+ {
+ /** === Test Data === */
+ /** === Mocks === */
+ /** === Test itself === */
+ $obj = new DataObject();
+ $this->assertEquals(null, $obj->getData());
+ $obj->setData(10);
+ $this->assertEquals(10, $obj->getData());
+ $obj->setData('string');
+ $this->assertEquals('string', $obj->getData());
+ $obj->setData(['array']);
+ $this->assertEquals(['array'], $obj->getData());
+ $obj->setData(new DataObject('key', 'value'));
+ $this->assertEquals('value', $obj->getData()->getData('key'));
+ }
public function test_unsetData()
{
|
Save complex objects as-is and navigate through nested DataObjects like through array.
|
flancer32_php_data_object
|
train
|
dc07a973967e97a7b455fbd074e854611190471a
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -12,7 +12,8 @@ function File(file) {
if (!file) file = {};
// record path change
- this.history = file.path ? [file.path] : [];
+ var history = file.path ? [file.path] : file.history;
+ this.history = history || [];
// TODO: should this be moved to vinyl-fs?
this.cwd = file.cwd || process.cwd();
@@ -59,21 +60,23 @@ File.prototype.clone = function(opt) {
opt.contents = opt.contents !== false;
}
- var file = new File({
- cwd: this.cwd,
- base: this.base,
- stat: (this.stat ? cloneStats(this.stat) : null)
- });
- file.history = this.history.slice();
-
// clone our file contents
+ var contents;
if (this.isStream()) {
- file.contents = this.contents.pipe(new Stream.PassThrough());
+ contents = this.contents.pipe(new Stream.PassThrough());
this.contents = this.contents.pipe(new Stream.PassThrough());
} else if (this.isBuffer()) {
- file.contents = opt.contents ? cloneBuffer(this.contents) : this.contents;
+ contents = opt.contents ? cloneBuffer(this.contents) : this.contents;
}
+ var file = new File({
+ cwd: this.cwd,
+ base: this.base,
+ stat: (this.stat ? cloneStats(this.stat) : null),
+ history: this.history.slice(),
+ contents: contents
+ });
+
// clone our custom properties
Object.keys(this).forEach(function(key) {
// ignore built-in fields
diff --git a/test/File.js b/test/File.js
index <HASH>..<HASH> 100644
--- a/test/File.js
+++ b/test/File.js
@@ -34,6 +34,12 @@ describe('File', function() {
done();
});
+ it('should default history to []', function(done) {
+ var file = new File();
+ file.history.should.eql([]);
+ done();
+ });
+
it('should default stat to null', function(done) {
var file = new File();
should.not.exist(file.stat);
@@ -64,6 +70,15 @@ describe('File', function() {
var val = '/test.coffee';
var file = new File({path: val});
file.path.should.equal(val);
+ file.history.should.eql([val]);
+ done();
+ });
+
+ it('should set history to given value', function(done) {
+ var val = '/test.coffee';
+ var file = new File({history: [val]});
+ file.path.should.equal(val);
+ file.history.should.eql([val]);
done();
});
|
Fix: Allow history to be set in the constructor (closes #<I>)
|
gulpjs_vinyl
|
train
|
c545a9780cd5008e53de2b05c67ba624a2b8d6b9
|
diff --git a/lib/juici/build_queue.rb b/lib/juici/build_queue.rb
index <HASH>..<HASH> 100644
--- a/lib/juici/build_queue.rb
+++ b/lib/juici/build_queue.rb
@@ -34,6 +34,10 @@ module Juici
@builds.sort_by(&:priority).first
end
+ def candidate_children
+ @builds.sort_by(&:priority)
+ end
+
def purge(by, build)
@builds.reject! do |i|
build.send(by) == i.send(by)
@@ -50,22 +54,30 @@ module Juici
def bump!
return unless @started
update_children
- if not_working? && work_to_do?
+
+ candidate_children.each do |child|
+ next if @child_pids.map do |pid|
+ if get_build_by_pid(pid).parent == child.parent
+ # We're already building something for this project
+ true
+ end
+ end.any?
+
+ # We're good to launch this build
Juici.dbgp "Starting another child process"
- next_child.tap do |child|
- if pid = child.build!
+ return child.tap do |cld|
+ if pid = cld.build!
Juici.dbgp "Started child: #{pid}"
@child_pids << pid
- @builds_by_pid[pid] = child
+ @builds_by_pid[pid] = cld
else
- Juici.dbgp "Child #{child} failed to start"
+ Juici.dbgp "Child #{cld} failed to start"
bump! # Ruby's recursion isn't great, but re{try,do} may as well be
# undefined behaviour here.
end
end
- else
- Juici.dbgp "I have quite enough to do"
end
+ Juici.dbgp "I have quite enough to do"
end
def update_children
diff --git a/spec/build_process_spec.rb b/spec/build_process_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/build_process_spec.rb
+++ b/spec/build_process_spec.rb
@@ -133,4 +133,58 @@ EOS
end
end
+ it "should queue builds for the same project" do
+ watcher = Juici::Watcher.instance.start
+ build1 = Juici::Build.new(parent: "test project",
+ environment: {},
+ command: "sleep 10")
+ build2 = Juici::Build.new(parent: "test project",
+ environment: {},
+ command: "sleep 10")
+
+ build1.save
+ build2.save
+
+ $build_queue << build1
+ $build_queue << build2
+
+ build1.status.should == Juici::BuildStatus::START
+ build2.status.should == Juici::BuildStatus::WAIT
+
+ build1.kill!
+ poll_build(build1)
+
+ build2.status.should == Juici::BuildStatus::START
+
+ build2.kill!
+ poll_build(build2)
+ end
+
+ it "should build different projects simultaneously" do
+ watcher = Juici::Watcher.instance.start
+ build1 = Juici::Build.new(parent: "test project1",
+ environment: {},
+ command: "sleep 10")
+ build2 = Juici::Build.new(parent: "test project2",
+ environment: {},
+ command: "sleep 10")
+
+ build1.save
+ build2.save
+
+ $build_queue << build1
+ $build_queue << build2
+
+ build1.status.should == Juici::BuildStatus::START
+ build2.status.should == Juici::BuildStatus::START
+
+ build1.kill!
+ poll_build(build1)
+
+ build2.status.should == Juici::BuildStatus::START
+
+ build2.kill!
+ poll_build(build2)
+ end
+
end
|
Build different projects in parrallel
|
richo_juici
|
train
|
be3cfe261df4b87ca702d8786ffe2e61cf906355
|
diff --git a/integration-tests/apps/rack/futures/app/tasks/some_task.rb b/integration-tests/apps/rack/futures/app/tasks/some_task.rb
index <HASH>..<HASH> 100644
--- a/integration-tests/apps/rack/futures/app/tasks/some_task.rb
+++ b/integration-tests/apps/rack/futures/app/tasks/some_task.rb
@@ -15,6 +15,7 @@ class SomeTask < TorqueBox::Messaging::Task
def with_status(payload={ })
future.status = '1'
future.status = '2'
+ sleep(3)
@backchannel.publish( 'release' )
@backchannel.receive( :timeout => 1_000 )
diff --git a/integration-tests/apps/rack/futures/something.rb b/integration-tests/apps/rack/futures/something.rb
index <HASH>..<HASH> 100644
--- a/integration-tests/apps/rack/futures/something.rb
+++ b/integration-tests/apps/rack/futures/something.rb
@@ -18,6 +18,7 @@ class Something
def with_status
future.status = '1'
future.status = '2'
+ sleep(3)
@backchannel.publish( 'release' )
@backchannel.receive( :timeout => 1_000 )
end
|
I hate to do it, but let's see if sleep() makes the test more robust.
|
torquebox_torquebox
|
train
|
50768d858a0778bcce7b71040b43ff397af3c0f9
|
diff --git a/cosmic_ray/worker.py b/cosmic_ray/worker.py
index <HASH>..<HASH> 100644
--- a/cosmic_ray/worker.py
+++ b/cosmic_ray/worker.py
@@ -21,12 +21,12 @@ try:
except ImportError:
pass
-from .config import serialize_config
-from .importing import preserve_modules, using_ast
-from .mutating import MutatingCore
-from .parsing import get_ast
-from .testing.test_runner import TestOutcome
-from .work_item import WorkItem, WorkItemJsonDecoder
+from cosmic_ray.config import serialize_config
+from cosmic_ray.importing import preserve_modules, using_ast
+from cosmic_ray.mutating import MutatingCore
+from cosmic_ray.parsing import get_ast
+from cosmic_ray.testing.test_runner import TestOutcome
+from cosmic_ray.work_item import WorkItem, WorkItemJsonDecoder
import cosmic_ray.compat.json
log = logging.getLogger()
|
using absolute import rather than relative in worker.py
|
sixty-north_cosmic-ray
|
train
|
a736e3cc8ab5c7ce3db4f01beb0a3f9ee343cc3b
|
diff --git a/src/_utils.js b/src/_utils.js
index <HASH>..<HASH> 100644
--- a/src/_utils.js
+++ b/src/_utils.js
@@ -476,7 +476,7 @@ export const makeSourceMapGenerator = file => {
export const addSourceMaps = (code, generator, filename) => {
const sourceMaps = [
convert.fromObject(generator).toComment({ multiline: true }),
- `/*@ sourceURL=${filename} */`
+ `/*@ sourceURL=${filename.replace(/\\/g, '\\\\')} */`
]
if (Array.isArray(code)) {
|
Escape filename in generated source map code. (#<I>)
Currently on windows `sourceURL`s for source maps are broken and if the path includes a file or folder that starts with "u" or "x" followed by an incorrect escape sequence the produced code fails to compile.
This replaces all instances of "\" inside the string with "\\" resulting in properly escaped backslashes.
Issue on next.js repo: <URL>
|
zeit_styled-jsx
|
train
|
1ed19e52558496d7aa73cbd386952321b1373abd
|
diff --git a/android/src/main/java/com/swmansion/reanimated/nodes/JSCallNode.java b/android/src/main/java/com/swmansion/reanimated/nodes/JSCallNode.java
index <HASH>..<HASH> 100644
--- a/android/src/main/java/com/swmansion/reanimated/nodes/JSCallNode.java
+++ b/android/src/main/java/com/swmansion/reanimated/nodes/JSCallNode.java
@@ -24,7 +24,12 @@ public class JSCallNode extends Node {
if (node.value() == null) {
args.pushNull();
} else {
- args.pushDouble(node.doubleValue());
+ Object value = node.value();
+ if (value instanceof String) {
+ args.pushString((String) value);
+ } else {
+ args.pushDouble(node.doubleValue());
+ }
}
}
WritableMap eventData = Arguments.createMap();
|
Allow call's input to be a string on Android (#<I>)
Motivation
On Android, JSCall exception is thrown type if node's value is a string
Changes
Added condition for checking if the type of node is a string and then handle it properly.
|
kmagiera_react-native-reanimated
|
train
|
598bf343494b8b71573d7fe2238326a80f8a3456
|
diff --git a/src/pipeline/pipeline.py b/src/pipeline/pipeline.py
index <HASH>..<HASH> 100755
--- a/src/pipeline/pipeline.py
+++ b/src/pipeline/pipeline.py
@@ -1041,17 +1041,13 @@ class After(object):
"""Initializer.
Args:
- *futures: One or more PipelineFutures that all subsequent pipelines
- should follow.
+ *futures: PipelineFutures that all subsequent pipelines should follow.
+ May be empty, in which case this statement does nothing.
"""
- if len(futures) == 0:
- raise TypeError(
- 'Must pass one or more PipelineFuture instances to After()')
self._futures = set(futures)
def __enter__(self):
"""When entering a 'with' block."""
- After._thread_init()
After._local._after_all_futures.extend(self._futures)
def __exit__(self, type, value, trace):
diff --git a/test/pipeline_test.py b/test/pipeline_test.py
index <HASH>..<HASH> 100755
--- a/test/pipeline_test.py
+++ b/test/pipeline_test.py
@@ -990,9 +990,16 @@ class PipelineTest(TestBase):
class OrderingTest(TestBase):
"""Tests for the Ordering classes."""
- def testAfterMissing(self):
+ def testAfterEmpty(self):
"""Tests when no futures are passed to the After() constructor."""
- self.assertRaises(TypeError, pipeline.After)
+ pipeline.After._after_all_futures = []
+ futures = []
+ after = pipeline.After(*futures)
+ self.assertEquals([], pipeline.After._local._after_all_futures)
+ after.__enter__()
+ self.assertEquals([], pipeline.After._local._after_all_futures)
+ self.assertFalse(after.__exit__(None, None, None))
+ self.assertEquals([], pipeline.After._local._after_all_futures)
def testAfter(self):
"""Tests the After class."""
|
Allow an empty list of futures to be passed to After()
|
GoogleCloudPlatform_appengine-pipelines
|
train
|
8e231986202b0dd2e15c131f5a29b031057e9f49
|
diff --git a/src/Sylius/Bundle/ResourceBundle/EventListener/KernelControllerSubscriber.php b/src/Sylius/Bundle/ResourceBundle/EventListener/KernelControllerSubscriber.php
index <HASH>..<HASH> 100644
--- a/src/Sylius/Bundle/ResourceBundle/EventListener/KernelControllerSubscriber.php
+++ b/src/Sylius/Bundle/ResourceBundle/EventListener/KernelControllerSubscriber.php
@@ -48,7 +48,7 @@ class KernelControllerSubscriber implements EventSubscriberInterface
private $apiGroupsHeader = 'Accept';
private $apiVersionRegexp = '/(v|version)=(?P<version>[0-9\.]+)/i';
- private $apiGroupsRegexp = '/(g|groups)=(?P<groups>[a-z,]+)/i';
+ private $apiGroupsRegexp = '/(g|groups)=(?P<groups>[a-z,_\s]+)/i';
public function __construct(ParametersParser $parametersParser, Parameters $parameters, array $settings, $forceApiVersion = false)
{
@@ -127,7 +127,7 @@ class KernelControllerSubscriber implements EventSubscriberInterface
if ($request->headers->has($this->apiGroupsHeader)) {
if (preg_match($this->apiGroupsRegexp, $request->headers->get($this->apiGroupsHeader), $matches)) {
- $data['serialization_groups'] = explode(',', $matches['groups']);
+ $data['serialization_groups'] = array_map('trim', explode(',', $matches['groups']));
}
}
|
Allow underline in group names for API `groups` header
Q | A
------------- | -------------
Bug fix? | yes
New feature? | no
BC breaks? | no
Deprecations? | no
Fixed tickets | -
License | MIT
Doc PR | -
Before this patch followoing header would not work as expected:
`Accept: application/json; groups=Details, form_type_sylius_product`
* Spaces were not allowed between group names.
* You could not have underline in a group name.
|
Sylius_Sylius
|
train
|
f729a61764d7a279180890fea780e80b6005c06e
|
diff --git a/starbound/btreedb4.py b/starbound/btreedb4.py
index <HASH>..<HASH> 100644
--- a/starbound/btreedb4.py
+++ b/starbound/btreedb4.py
@@ -126,7 +126,7 @@ class BTreeIndex(sbbf02.Block):
__slots__ = ['keys', 'level', 'num_keys', 'values']
- def __init__(self, file):
+ def __init__(self, file, block_index):
self.level, self.num_keys, left_block = struct.unpack('>Bii', file.read(9))
self.keys = []
@@ -152,7 +152,7 @@ class BTreeLeaf(sbbf02.Block):
__slots__ = ['data', 'next_block']
- def __init__(self, file):
+ def __init__(self, file, block_index):
# Substract 6 for signature and next_block.
self.data = file.read(file.block_size - 6)
diff --git a/starbound/sbbf02.py b/starbound/sbbf02.py
index <HASH>..<HASH> 100644
--- a/starbound/sbbf02.py
+++ b/starbound/sbbf02.py
@@ -28,8 +28,10 @@ class BlockMeta(type):
class Block(BlockMeta('Block', (object,), {})):
types = dict()
+ __slots__ = ['index']
+
@staticmethod
- def read(file):
+ def read(file, block_index):
signature = file.read(2)
if signature == b'\x00\x00':
@@ -39,7 +41,9 @@ class Block(BlockMeta('Block', (object,), {})):
raise ValueError('Unrecognized block type')
# Return a new instance of the appropriate block type.
- return Block.types[signature](file)
+ block = Block.types[signature](file, block_index)
+ block.index = block_index
+ return block
class BlockFree(Block):
@@ -47,7 +51,7 @@ class BlockFree(Block):
__slots__ = ['next_free_block', 'raw_data']
- def __init__(self, file):
+ def __init__(self, file, block_index):
self.raw_data = file.read(file.block_size - 2)
value, = struct.unpack('>i', self.raw_data[:4])
self.next_free_block = value if value != -1 else None
@@ -67,9 +71,9 @@ class FileSBBF02(filebase.File):
self.free_block_is_dirty = None
self.free_block = None
- def get_block(self, block):
- self._stream.seek(self.header_size + self.block_size * block)
- return Block.read(self)
+ def get_block(self, block_index):
+ self._stream.seek(self.header_size + self.block_size * block_index)
+ return Block.read(self, block_index)
def get_user_header(self):
assert self.is_open(), 'File must be open to get user header'
|
Make the block index available to Block instances
|
blixt_py-starbound
|
train
|
a4dc65a48313e0a09f7e1f4b983d852295b29631
|
diff --git a/packages/ra-ui-materialui/src/list/List.js b/packages/ra-ui-materialui/src/list/List.js
index <HASH>..<HASH> 100644
--- a/packages/ra-ui-materialui/src/list/List.js
+++ b/packages/ra-ui-materialui/src/list/List.js
@@ -9,11 +9,13 @@ import { ListController, getListControllerProps } from 'ra-core';
import Title from '../layout/Title';
import ListToolbar from './ListToolbar';
import DefaultPagination from './Pagination';
-import DefaultBulkActionButtons from '../button/BulkDeleteButton';
+import BulkDeleteButton from '../button/BulkDeleteButton';
import BulkActionsToolbar from './BulkActionsToolbar';
import DefaultActions from './ListActions';
import defaultTheme from '../defaultTheme';
+const DefaultBulkActionButtons = props => <BulkDeleteButton {...props} />;
+
export const styles = createStyles({
root: {
display: 'flex',
@@ -146,8 +148,7 @@ export const ListView = ({
bulkActions !== false &&
bulkActionButtons !== false,
})}
- {pagination &&
- cloneElement(pagination, controllerProps)}
+ {pagination && cloneElement(pagination, controllerProps)}
</div>
</Card>
{aside && cloneElement(aside, controllerProps)}
|
Fix warning about missing BulkDeleteButton props
|
marmelab_react-admin
|
train
|
3f817c56fd34f697872e1053b97f13c544dee70d
|
diff --git a/src/java/grails/util/Environment.java b/src/java/grails/util/Environment.java
index <HASH>..<HASH> 100644
--- a/src/java/grails/util/Environment.java
+++ b/src/java/grails/util/Environment.java
@@ -107,6 +107,13 @@ public enum Environment {
return getCurrent();
}
+ /**
+ * Returns true if the application is running in development mode (within grails run-app)
+ * @return True if the application is running in development mode
+ */
+ public static boolean isDevelopmentMode() {
+ return getCurrent() == DEVELOPMENT && !(Metadata.getCurrent().isWarDeployed()) && System.getProperty("grails.home")!=null;
+ }
/**
* @return Return true if the environment has been set as a Systme property
diff --git a/src/java/org/codehaus/groovy/grails/orm/hibernate/ConfigurableLocalSessionFactoryBean.java b/src/java/org/codehaus/groovy/grails/orm/hibernate/ConfigurableLocalSessionFactoryBean.java
index <HASH>..<HASH> 100644
--- a/src/java/org/codehaus/groovy/grails/orm/hibernate/ConfigurableLocalSessionFactoryBean.java
+++ b/src/java/org/codehaus/groovy/grails/orm/hibernate/ConfigurableLocalSessionFactoryBean.java
@@ -135,7 +135,7 @@ public class ConfigurableLocalSessionFactoryBean extends
if(isCacheConfigurationError(cause)) {
LOG.fatal("There was an error configuring the Hibernate second level cache: " + getCauseMessage(e));
LOG.fatal("This is normally due to one of two reasons. Either you have incorrectly specified the cache provider class name in [DataSource.groovy] or you do not have the cache provider on your classpath (eg. runtime (\"net.sf.ehcache:ehcache:1.6.1\"))");
- if(grails.util.Environment.getCurrent() == grails.util.Environment.DEVELOPMENT && !(getGrailsApplication().isWarDeployed()))
+ if(grails.util.Environment.isDevelopmentMode())
System.exit(1);
}
throw e;
|
fixes the problem that broke the ability to run some Grails core tests within STS or IntelliJ
|
grails_grails-core
|
train
|
b584b56df6267eaafbe33087243b9aaa593c9642
|
diff --git a/src/foundations/walkers.py b/src/foundations/walkers.py
index <HASH>..<HASH> 100644
--- a/src/foundations/walkers.py
+++ b/src/foundations/walkers.py
@@ -264,7 +264,7 @@ def dictionariesWalker(dictionary, path=()):
@core.executionTrace
@foundations.exceptions.exceptionsHandler(None, False, Exception)
-def nodesWalker(node):
+def nodesWalker(node, ascendants=False):
"""
This definition is a generator used to walk into nodes hierarchy.
@@ -289,14 +289,22 @@ def nodesWalker(node):
MyNodeC
:param node: Node to walk. ( AbstractCompositeNode )
+ :param ascendants: Ascendants instead of descendants will be yielded. ( Boolean )
:return: Node. ( AbstractNode / AbstractCompositeNode )
"""
- if not hasattr(node, "children"):
+ attribute = "children" if not ascendants else "parent"
+ if not hasattr(node, attribute):
return
- for child in node.children:
- yield child
- if child.children:
- for value in nodesWalker(child):
- yield value
+ elements = getattr(node, attribute)
+ elements = elements if isinstance(elements, list) else [elements]
+
+ for element in elements:
+ yield element
+
+ if not getattr(element, attribute):
+ continue
+
+ for subElement in nodesWalker(element, ascendants=ascendants):
+ yield subElement
diff --git a/src/tests/testsFoundations/testsWalkers.py b/src/tests/testsFoundations/testsWalkers.py
index <HASH>..<HASH> 100644
--- a/src/tests/testsFoundations/testsWalkers.py
+++ b/src/tests/testsFoundations/testsWalkers.py
@@ -165,9 +165,12 @@ class NodesWalkerTestCase(unittest.TestCase):
nodeF = AbstractCompositeNode("MyNodeF", nodeD)
nodeG = AbstractCompositeNode("MyNodeG", nodeF)
nodeH = AbstractCompositeNode("MyNodeH", nodeG)
- yieldedValues = (nodeB, nodeC, nodeD, nodeE, nodeF, nodeG, nodeH)
- for node in foundations.walkers.nodesWalker(nodeA):
- self.assertIn(node, yieldedValues)
+ values = [nodeB, nodeC, nodeD, nodeE, nodeF, nodeG, nodeH]
+ for node in values:
+ self.assertIn(node, list(foundations.walkers.nodesWalker(nodeA)))
+
+ values = [nodeG, nodeF, nodeD, nodeB, nodeA]
+ self.assertEquals(list(foundations.walkers.nodesWalker(nodeH, ascendants=True)), values)
if __name__ == "__main__":
import tests.utilities
|
Add ascendants yielding capability to "foundations.walkers.nodesWalker" iterator definition.
|
KelSolaar_Foundations
|
train
|
4edbe770eb6d057f3d4d3d31e841df65d7209790
|
diff --git a/graphql_compiler/compiler/ir_lowering_sql/__init__.py b/graphql_compiler/compiler/ir_lowering_sql/__init__.py
index <HASH>..<HASH> 100644
--- a/graphql_compiler/compiler/ir_lowering_sql/__init__.py
+++ b/graphql_compiler/compiler/ir_lowering_sql/__init__.py
@@ -41,7 +41,7 @@ def lower_ir(ir_blocks, query_metadata_table, type_equivalence_hints=None):
tree representation of IR blocks for recursive traversal by SQL backend.
"""
_validate_all_blocks_supported(ir_blocks, query_metadata_table)
- construct_result = ir_blocks.pop()
+ construct_result = _get_construct_result(ir_blocks)
query_path_to_location_info = _map_query_path_to_location_info(query_metadata_table)
query_path_to_output_fields = _map_query_path_to_outputs(
construct_result, query_path_to_location_info)
@@ -73,7 +73,7 @@ def lower_ir(ir_blocks, query_metadata_table, type_equivalence_hints=None):
def _validate_all_blocks_supported(ir_blocks, query_metadata_table):
- """Validate that all IR blocks and ConstructResult fields passed to the are supported.
+ """Validate that all IR blocks and ConstructResult fields passed to the backend are supported.
Args:
ir_blocks: List[BasicBlock], IR blocks to validate.
@@ -89,7 +89,7 @@ def _validate_all_blocks_supported(ir_blocks, query_metadata_table):
u'Unexpectedly attempting to validate IR blocks with fewer than 3 blocks. A minimal '
u'query is expected to have at least a QueryRoot, GlobalOperationsStart, and '
u'ConstructResult block. The query metadata table is {}.'.format(query_metadata_table))
- last_block = ir_blocks[-1]
+ construct_result = _get_construct_result(ir_blocks)
unsupported_blocks = []
unsupported_fields = []
for block in ir_blocks[:-1]:
@@ -99,12 +99,7 @@ def _validate_all_blocks_supported(ir_blocks, query_metadata_table):
continue
unsupported_blocks.append(block)
- if not isinstance(last_block, blocks.ConstructResult):
- raise AssertionError(
- u'The last IR block {} for IR blocks {} was unexpectedly not '
- u'a ConstructResult block.'.format(last_block, ir_blocks))
-
- for field_name, field in six.iteritems(last_block.fields):
+ for field_name, field in six.iteritems(construct_result.fields):
if not isinstance(field, constants.SUPPORTED_OUTPUT_EXPRESSION_TYPES):
unsupported_fields.append((field_name, field))
elif field_name in constants.UNSUPPORTED_META_FIELDS:
@@ -117,6 +112,16 @@ def _validate_all_blocks_supported(ir_blocks, query_metadata_table):
unsupported_blocks, unsupported_fields, ir_blocks, query_metadata_table))
+def _get_construct_result(ir_blocks):
+ """Return the ConstructResult block from a list of IR blocks."""
+ last_block = ir_blocks[-1]
+ if not isinstance(last_block, blocks.ConstructResult):
+ raise AssertionError(
+ u'The last IR block {} for IR blocks {} was unexpectedly not '
+ u'a ConstructResult block.'.format(last_block, ir_blocks))
+ return last_block
+
+
def _map_query_path_to_location_info(query_metadata_table):
"""Create a map from each query path to a LocationInfo at that path.
diff --git a/graphql_compiler/compiler/ir_lowering_sql/constants.py b/graphql_compiler/compiler/ir_lowering_sql/constants.py
index <HASH>..<HASH> 100644
--- a/graphql_compiler/compiler/ir_lowering_sql/constants.py
+++ b/graphql_compiler/compiler/ir_lowering_sql/constants.py
@@ -14,6 +14,8 @@ SKIPPABLE_BLOCK_TYPES = (
blocks.MarkLocation,
# Global operations are used as a marker, but do not require other handling by the SQL backend.
blocks.GlobalOperationsStart,
+ # ConstructResult blocks are given special handling, they can otherwise be disregarded.
+ blocks.ConstructResult,
)
SUPPORTED_BLOCK_TYPES = (
|
Making ConstructResult handling clear, not modifying IR blocks
|
kensho-technologies_graphql-compiler
|
train
|
feee60fdffd792b4cc4ddc3e1d4ec7d613e0d24b
|
diff --git a/packages/cozy-konnector-libs/src/index.js b/packages/cozy-konnector-libs/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/cozy-konnector-libs/src/index.js
+++ b/packages/cozy-konnector-libs/src/index.js
@@ -1,6 +1,7 @@
const log = require('cozy-logger').namespace('cozy-konnector-libs')
const requestFactory = require('./libs/request')
const hydrateAndFilter = require('./libs/hydrateAndFilter')
+require('isomorphic-fetch')
require('./libs/error')
diff --git a/packages/cozy-konnector-libs/src/libs/categorization/index.spec.js b/packages/cozy-konnector-libs/src/libs/categorization/index.spec.js
index <HASH>..<HASH> 100644
--- a/packages/cozy-konnector-libs/src/libs/categorization/index.spec.js
+++ b/packages/cozy-konnector-libs/src/libs/categorization/index.spec.js
@@ -2,6 +2,7 @@
* @jest-environment node
*/
+require('isomorphic-fetch')
const categorize = require('.')
const { globalModel } = require('./globalModel')
const { localModel } = require('./localModel')
diff --git a/packages/cozy-konnector-libs/src/libs/categorization/localModel.spec.js b/packages/cozy-konnector-libs/src/libs/categorization/localModel.spec.js
index <HASH>..<HASH> 100644
--- a/packages/cozy-konnector-libs/src/libs/categorization/localModel.spec.js
+++ b/packages/cozy-konnector-libs/src/libs/categorization/localModel.spec.js
@@ -1,6 +1,7 @@
/**
* @jest-environment node
*/
+require('isomorphic-fetch')
const {
getUniqueCategories,
getAlphaParameter,
diff --git a/packages/cozy-konnector-libs/src/libs/linkBankOperations.spec.js b/packages/cozy-konnector-libs/src/libs/linkBankOperations.spec.js
index <HASH>..<HASH> 100644
--- a/packages/cozy-konnector-libs/src/libs/linkBankOperations.spec.js
+++ b/packages/cozy-konnector-libs/src/libs/linkBankOperations.spec.js
@@ -1,3 +1,4 @@
+require('isomorphic-fetch')
const { Linker } = require('./linkBankOperations')
jest.mock('./cozyclient')
diff --git a/packages/cozy-konnector-libs/src/libs/linker/billsToOperation/findNeighboringOperations.spec.js b/packages/cozy-konnector-libs/src/libs/linker/billsToOperation/findNeighboringOperations.spec.js
index <HASH>..<HASH> 100644
--- a/packages/cozy-konnector-libs/src/libs/linker/billsToOperation/findNeighboringOperations.spec.js
+++ b/packages/cozy-konnector-libs/src/libs/linker/billsToOperation/findNeighboringOperations.spec.js
@@ -2,6 +2,7 @@ const {
findByMangoQuerySimple,
findNeighboringOperations
} = require('./findNeighboringOperations')
+require('isomorphic-fetch')
jest.mock('../../cozyclient')
const cozyClient = require('../../cozyclient')
diff --git a/packages/cozy-konnector-libs/src/libs/mkdirp.spec.js b/packages/cozy-konnector-libs/src/libs/mkdirp.spec.js
index <HASH>..<HASH> 100644
--- a/packages/cozy-konnector-libs/src/libs/mkdirp.spec.js
+++ b/packages/cozy-konnector-libs/src/libs/mkdirp.spec.js
@@ -1,3 +1,4 @@
+require('isomorphic-fetch')
const { join } = require('path').posix
const mkdirpFromCozy = require('./mkdirp').fromCozy
diff --git a/packages/cozy-konnector-libs/src/libs/saveFiles.spec.js b/packages/cozy-konnector-libs/src/libs/saveFiles.spec.js
index <HASH>..<HASH> 100644
--- a/packages/cozy-konnector-libs/src/libs/saveFiles.spec.js
+++ b/packages/cozy-konnector-libs/src/libs/saveFiles.spec.js
@@ -1,3 +1,4 @@
+require('isomorphic-fetch')
jest.mock('./cozyclient')
const cozyClient = require('./cozyclient')
//jest.mock('./utils')
|
fix: add isomorphic-fetch to unit tests
This is due to a change of pouch dependency in cozy-client-js which now use pouchdb-browser instead of pouchdb
|
konnectors_libs
|
train
|
762fefeb93ce6347a0bdbfebc5de20bb2accc93e
|
diff --git a/ndb/query.py b/ndb/query.py
index <HASH>..<HASH> 100644
--- a/ndb/query.py
+++ b/ndb/query.py
@@ -15,9 +15,12 @@ For example:
rank = IntegerProperty()
@classmethod
- def seniors(cls, min_age, min_rank):
- return cls.query().filter(AND(cls.age >= min_age,
- cls.rank >= min_rank)).order(cls.name)
+ def demographic(cls, min_age, max_age):
+ return cls.query().filter(AND(cls.age >= min_age, cls.age <= max_age))
+
+ @classmethod
+ def ranked(cls, rank):
+ return cls.query(cls.rank == rank).order(cls.age)
for emp in Employee.seniors(42, 5):
print emp.name, emp.age, emp.rank
@@ -45,8 +48,8 @@ Query object; the above calls to filter() do not affect q1.
Sort orders can also be combined this way, and .filter() and .order()
calls may be intermixed:
- q4 = q3.order(Employee.name)
- q5 = q4.order(-Employee.age)
+ q4 = q3.order(-Employee.age)
+ q5 = q4.order(Employee.name)
q6 = q5.filter(Employee.rank == 5)
The simplest way to retrieve Query results is a for-loop:
@@ -332,7 +335,7 @@ class DisjunctionNode(Node):
def AND(*args):
assert args
- assert all(isinstance(Node, arg) for arg in args)
+ assert all(isinstance(arg, Node) for arg in args)
if len(args) == 1:
return args[0]
return ConjunctionNode(args)
diff --git a/startup.py b/startup.py
index <HASH>..<HASH> 100644
--- a/startup.py
+++ b/startup.py
@@ -16,3 +16,21 @@ apiproxy_stub_map.apiproxy.RegisterStub('datastore_v3', ds_stub)
mc_stub = memcache_stub.MemcacheServiceStub()
apiproxy_stub_map.apiproxy.RegisterStub('memcache', mc_stub)
os.environ['APPLICATION_ID'] = '_'
+
+class Employee(Model):
+ name = StringProperty()
+ age = IntegerProperty()
+ rank = IntegerProperty()
+
+ @classmethod
+ def demographic(cls, min_age, max_age):
+ return cls.query().filter(AND(cls.age >= min_age, cls.age <= max_age))
+
+ @classmethod
+ def ranked(cls, rank):
+ return cls.query(cls.rank == rank).order(cls.age)
+
+for (name, age, rank) in [('Joe', 21, 1), ('Jim', 30, 2), ('Jane', 23, 1)]:
+ Employee(name=name, age=age, rank=rank).put()
+
+del name, age, rank
|
Provide examples that actually work. Add to startup.py.
|
GoogleCloudPlatform_datastore-ndb-python
|
train
|
f1cae08b570703e915f06172b0bbbb54f6d96150
|
diff --git a/pyaxiom/netcdf/grids/binner.py b/pyaxiom/netcdf/grids/binner.py
index <HASH>..<HASH> 100644
--- a/pyaxiom/netcdf/grids/binner.py
+++ b/pyaxiom/netcdf/grids/binner.py
@@ -56,7 +56,7 @@ def main(output_path, delta, ncml_file=None, glob_string=None, apply_to_members=
file_name = "{0}_TO_{1}.nc".format(starting, ending)
output_file = os.path.join(output_path, file_name)
- pyaxiomlogger.info("Combining ({0}/{1}) - {3} files into {1}".format(i+1, len(windows), len(window.members), output_file))
+ pyaxiomlogger.info("Combining ({0}/{1}) - {2} files into {3}".format(i+1, len(windows), len(window.members), output_file))
Collection.combine(members=window.members, output_file=output_file)
return 0
|
Fix logging message when combining through `binner`
|
axiom-data-science_pyaxiom
|
train
|
ad3259bd07946744f55e07954ac98c0b7d6aa04f
|
diff --git a/ezinfo.php b/ezinfo.php
index <HASH>..<HASH> 100644
--- a/ezinfo.php
+++ b/ezinfo.php
@@ -10,12 +10,24 @@ class ggwebservicesInfo
'Copyright' => "Copyright (C) 2009-2010 Gaetano Giunta",
'License' => "GNU General Public License v2.0",
'Includes the following third-party software' => array(
- 'phpxmlrpc' => 'http://phpxmlrpc.sourceforge.net/',
+ 'Name' => 'YUI',
+ 'Version' => "2.5.0",
+ 'Copyright' => 'Copyright (c) 2010, Yahoo! Inc. All rights reserved.',
+ 'License' => 'Licensed under the BSD License' ),
+ 'Includes the following third-party software (2)' => array(
+ 'Name' => 'phpxmlrpc',
+ 'Version' => "3.0.0.beta",
+ 'Copyright' => 'Copyright (c) 1999,2000,2002 Edd Dumbill.',
+ 'License' => 'Licensed under the BSD License' ),
+ 'Includes the following third-party software (3)' => array(
+ 'Name' => 'jQuery JSON Plugin',
+ 'Version' => "2.1",
+ 'Copyright' => 'Brantley Harris (?)',
+ 'License' => 'MIT License' )
/*'nuSOAP' => array(
'Version' => '2008-04-06',
'License' => 'GNU/LGPL v2.1 - Copyright (c) 2002 NuSphere Corporation',
'For more information' => 'http://sourceforge.net/projects/nusoap' ),*/
- )
);
}
}
|
- update declaration of included sw in ezinfo.php
|
gggeek_ggwebservices
|
train
|
4e5c6f9d4003011019134007bb0dea77d047082e
|
diff --git a/lib/chef/resource_collection.rb b/lib/chef/resource_collection.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/resource_collection.rb
+++ b/lib/chef/resource_collection.rb
@@ -54,6 +54,9 @@ class Chef
end
end
+ # 'push' is an alias method to <<
+ alias_method :push, :<<
+
def insert(resource)
is_chef_resource(resource)
if @insert_after_idx
@@ -73,14 +76,6 @@ class Chef
end
end
- def push(*args)
- args.flatten.each do |arg|
- is_chef_resource(arg)
- @resources.push(arg)
- @resources_by_name[arg.to_s] = @resources.length - 1
- end
- end
-
def each
@resources.each do |resource|
yield resource
|
removed duplicate for push in resource_collection
|
chef_chef
|
train
|
09cb49542364694f2eec84f61b63e40ae8dcd05f
|
diff --git a/dvc/version.py b/dvc/version.py
index <HASH>..<HASH> 100644
--- a/dvc/version.py
+++ b/dvc/version.py
@@ -6,7 +6,7 @@
import os
import subprocess
-_BASE_VERSION = "2.0.13"
+_BASE_VERSION = "2.0.14"
def _generate_version(base_version):
|
dvc: bump to <I>
|
iterative_dvc
|
train
|
8868373c3bf5c9eb38d912280110288053d5c383
|
diff --git a/packages/Box/handleResponsiveStyles.js b/packages/Box/handleResponsiveStyles.js
index <HASH>..<HASH> 100644
--- a/packages/Box/handleResponsiveStyles.js
+++ b/packages/Box/handleResponsiveStyles.js
@@ -6,15 +6,13 @@ const DESKTOP_BREAKPOINTS = ['md', 'lg', 'xl']
export const isMobileBreakpoint = breakpoint => MOBILE_BREAKPOINTS.indexOf(breakpoint) !== -1
export const isDesktopBreakpoint = breakpoint => DESKTOP_BREAKPOINTS.indexOf(breakpoint) !== -1
-const isNumber = x => typeof x === 'number'
-
const handleBoundaryCrossing = (acc, curr) => {
if (
isMobileBreakpoint(curr.from) &&
((curr.until !== 'md' && isDesktopBreakpoint(curr.until)) || typeof curr.until === 'undefined')
) {
const props = Object.keys(curr.props).filter(
- prop => isNumber(curr.props[prop]) && curr.props[prop] > 3
+ prop => typeof curr.props[prop] === 'number' && curr.props[prop] > 3
)
if (props.length !== 0) {
const mobileBreakpoint = Object.assign({}, curr, { props: curr.props })
|
chore(core-box): simplify if statement in responsive handler
|
telus_tds-core
|
train
|
c8db8d415467b357a4861e88f8ed5432626dad63
|
diff --git a/scriptabit/habitica_service.py b/scriptabit/habitica_service.py
index <HASH>..<HASH> 100644
--- a/scriptabit/habitica_service.py
+++ b/scriptabit/habitica_service.py
@@ -356,3 +356,39 @@ class HabiticaService(object):
response = self.__put('user', {'stats.gp': gp})
response.raise_for_status()
return response.json()['data']['stats']['gp']
+
+ def get_tags(self):
+ """ Get the current user's tags.
+
+ Returns:
+ list: The tags.
+ """
+ response = self.__get('tags')
+ response.raise_for_status()
+ return response.json()['data']
+
+ def create_tag(self, name):
+ """ Create a tag.
+
+ Args:
+ name (str): the tag name.
+
+ Returns:
+ dict: The new tag.
+ """
+ response = self.__post('tags', data={'name': name})
+ response.raise_for_status()
+ return response.json()['data']
+
+ def create_tags(self, tags):
+ """ Create the tags. Existing tags are ignored.
+
+ Args:
+ tags (list): The list of tags.
+ """
+ existing = [t['name'] for t in self.get_tags()]
+ for required in tags:
+ if required not in existing:
+ self.create_tag(required)
+
+
diff --git a/scriptabit/habitica_task_service.py b/scriptabit/habitica_task_service.py
index <HASH>..<HASH> 100644
--- a/scriptabit/habitica_task_service.py
+++ b/scriptabit/habitica_task_service.py
@@ -18,14 +18,20 @@ from .task_service import TaskService
class HabiticaTaskService(TaskService):
""" Implements the Habitica synchronisation task service.
"""
- def __init__(self, hs):
+ def __init__(self, hs, tags=None):
""" Initialises the Habitica synchronisation task service.
Args:
hs (HabiticaService): The Habitica Service.
+ tags (list): The list of tags to be applied to synchronised tasks.
"""
super().__init__()
+
self.__hs = hs
+ self.__task_tags = tags
+
+ if tags:
+ self.__hs.create_tags(tags)
def get_all_tasks(self):
""" Get all tasks.
diff --git a/scriptabit/plugins/trello/trello.py b/scriptabit/plugins/trello/trello.py
index <HASH>..<HASH> 100644
--- a/scriptabit/plugins/trello/trello.py
+++ b/scriptabit/plugins/trello/trello.py
@@ -119,7 +119,9 @@ If empty, then cards are only marked done when archived.''')
token_secret=credentials['tokensecret'])
# instantiate the HabiticaTaskService
- self.__habitica_task_service = HabiticaTaskService(habitica_service)
+ self.__habitica_task_service = HabiticaTaskService(
+ habitica_service,
+ tags=['Trello'])
self.__task_map_file = os.path.join(
self._data_dir,
diff --git a/scriptabit/utility_functions.py b/scriptabit/utility_functions.py
index <HASH>..<HASH> 100644
--- a/scriptabit/utility_functions.py
+++ b/scriptabit/utility_functions.py
@@ -148,14 +148,9 @@ class UtilityFunctions(object):
print()
logging.getLogger(__name__).debug('Running test function')
print("--------------------")
- task = self.__hs.create_task(
- {'text':'new'},
- task_type=HabiticaTaskTypes.todos)
- pprint(task)
- pprint(self.__hs.get_user())
- # tasks = self.__hs.get_tasks()
- # tasks = self.__hs.get_tasks(task_type=HabiticaTaskTypes.dailies)
- # for t in tasks:
- # pprint(t['type'])
+ # pprint(self.__hs.get_tags())
+ # pprint(self.__hs.create_tag('new tag'))
+ self.__hs.create_tags(['a','b','c','new tag'])
+ pprint(self.__hs.get_tags())
print("--------------------")
print()
|
added habitica service methods to query and create tags
|
DC23_scriptabit
|
train
|
ae182a7c20154c19b38f651f7276118074be7795
|
diff --git a/builder/qemu/step_forward_ssh.go b/builder/qemu/step_forward_ssh.go
index <HASH>..<HASH> 100644
--- a/builder/qemu/step_forward_ssh.go
+++ b/builder/qemu/step_forward_ssh.go
@@ -4,9 +4,8 @@ import (
"context"
"fmt"
"log"
- "math/rand"
- "net"
+ "github.com/hashicorp/packer/common/net"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
)
@@ -17,31 +16,30 @@ import (
// Uses:
//
// Produces:
-type stepForwardSSH struct{}
+type stepForwardSSH struct {
+ l *net.Listener
+}
-func (s *stepForwardSSH) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
+func (s *stepForwardSSH) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction {
config := state.Get("config").(*Config)
ui := state.Get("ui").(packer.Ui)
log.Printf("Looking for available communicator (SSH, WinRM, etc) port between %d and %d", config.SSHHostPortMin, config.SSHHostPortMax)
- var sshHostPort uint
-
- portRange := config.SSHHostPortMax - config.SSHHostPortMin + 1
- offset := uint(rand.Intn(int(portRange)))
-
- for {
- sshHostPort = offset + config.SSHHostPortMin
- log.Printf("Trying port: %d", sshHostPort)
- l, err := net.Listen("tcp", fmt.Sprintf(":%d", sshHostPort))
- if err == nil {
- defer l.Close()
- break
- }
- offset++
- if offset == portRange {
- offset = 0
- }
+ var err error
+ s.l, err = net.ListenRangeConfig{
+ Addr: config.VNCBindAddress,
+ Min: config.VNCPortMin,
+ Max: config.VNCPortMax,
+ Network: "tcp",
+ }.Listen(ctx)
+ if err != nil {
+ err := fmt.Errorf("Error finding port: %s", err)
+ state.Put("error", err)
+ ui.Error(err.Error())
+ return multistep.ActionHalt
}
+ s.l.Listener.Close() // free port, but don't unlock lock file
+ sshHostPort := s.l.Port
ui.Say(fmt.Sprintf("Found port for communicator (SSH, WinRM, etc): %d.", sshHostPort))
// Save the port we're using so that future steps can use it
@@ -50,4 +48,11 @@ func (s *stepForwardSSH) Run(_ context.Context, state multistep.StateBag) multis
return multistep.ActionContinue
}
-func (s *stepForwardSSH) Cleanup(state multistep.StateBag) {}
+func (s *stepForwardSSH) Cleanup(state multistep.StateBag) {
+ if s.l != nil {
+ err := s.l.Close()
+ if err != nil {
+ log.Printf("failed to unlock port lockfile: %v", err)
+ }
+ }
+}
|
qemu stepForwardSSH: use common/net pkg to find open port
|
hashicorp_packer
|
train
|
a05e06245dbf2b43411a33b72350de99b4e1d64f
|
diff --git a/kernel/src/main/java/org/efaps/db/Insert.java b/kernel/src/main/java/org/efaps/db/Insert.java
index <HASH>..<HASH> 100644
--- a/kernel/src/main/java/org/efaps/db/Insert.java
+++ b/kernel/src/main/java/org/efaps/db/Insert.java
@@ -28,6 +28,7 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.UUID;
import java.util.Map.Entry;
import org.slf4j.Logger;
@@ -78,7 +79,15 @@ public class Insert extends Update
this(Type.get(_type));
}
-
+ /**
+ * @param _uuid _uuid of the type to be inserted
+ * @see #Insert(Type)
+ * @throws EFapsException on error
+ */
+ public Insert(final UUID _uuid) throws EFapsException
+ {
+ this(Type.get(_uuid));
+ }
/**
* Add all tables of the type to the expressions, because for the type an
* insert must be made for all tables!!!
diff --git a/kernel/src/main/java/org/efaps/db/SearchQuery.java b/kernel/src/main/java/org/efaps/db/SearchQuery.java
index <HASH>..<HASH> 100644
--- a/kernel/src/main/java/org/efaps/db/SearchQuery.java
+++ b/kernel/src/main/java/org/efaps/db/SearchQuery.java
@@ -21,6 +21,7 @@
package org.efaps.db;
import java.util.StringTokenizer;
+import java.util.UUID;
import org.joda.time.ReadableDateTime;
import org.joda.time.format.ISODateTimeFormat;
@@ -59,25 +60,38 @@ public class SearchQuery extends AbstractQuery
/**
* Set the type for the query.
+ * @param _uuid UUID of the type to be used
+ * @throws EFapsException on error
+ * @return this SearchQuery
+ */
+ public SearchQuery setQueryTypes(final UUID _uuid) throws EFapsException
+ {
+ return setQueryTypes(Type.get(_uuid), true);
+ }
+
+ /**
+ * Set the type for the query.
* @param _types type to be used
* @throws EFapsException on error
+ * @return this SearchQuery
*/
- public void setQueryTypes(final String _types) throws EFapsException
+ public SearchQuery setQueryTypes(final String _types) throws EFapsException
{
- setQueryTypes(_types, true);
+ return setQueryTypes(Type.get(_types), true);
}
/**
* Set the type for the query.
- * @param _types type to be used
+ * @param _type type to be used
* @param _companyDepend if <code>true</code> the company will be
* included if necessary automatically
* @throws EFapsException on error
+ * @return this SearchQuery
*/
- public void setQueryTypes(final String _types, final boolean _companyDepend) throws EFapsException
+ public SearchQuery setQueryTypes(final Type _type, final boolean _companyDepend) throws EFapsException
{
- if (_types != null) {
- this.type = Type.get(_types);
+ if (_type != null) {
+ this.type = _type;
setExpandChildTypes(false);
addSelect(true, this.type, this.type, "OID");
this.types.add(this.type);
@@ -88,6 +102,7 @@ public class SearchQuery extends AbstractQuery
addWhereAttrEqValue(this.type.getCompanyAttribute(), Context.getThreadContext().getCompany().getId());
}
}
+ return this;
}
/**
|
- the SearchQuery and Insert work now also with the UUID of a type
git-svn-id: <URL>
|
eFaps_eFaps-Kernel
|
train
|
e9f61661efe1043c799a51705f1e8ac6b3ff6033
|
diff --git a/lib/watir/window.rb b/lib/watir/window.rb
index <HASH>..<HASH> 100644
--- a/lib/watir/window.rb
+++ b/lib/watir/window.rb
@@ -207,6 +207,9 @@ module Watir
if @selector.empty?
nil
elsif @selector.key?(:index)
+ Watir.logger.deprecate 'Using :index as a selector for Window', ':title or :url',
+ reference: 'http://watir.com/guides/windows/#locating-by-index-is-no-longer-supported',
+ ids: [:window_index]
@driver.window_handles[Integer(@selector[:index])]
else
@driver.window_handles.find { |wh| matches?(wh) }
diff --git a/spec/watirspec/support/rspec_matchers.rb b/spec/watirspec/support/rspec_matchers.rb
index <HASH>..<HASH> 100644
--- a/spec/watirspec/support/rspec_matchers.rb
+++ b/spec/watirspec/support/rspec_matchers.rb
@@ -16,7 +16,8 @@ if defined?(RSpec)
select_by
value_button
wait_until_present
- wait_while_present].freeze
+ wait_while_present
+ window_index].freeze
DEPRECATION_WARNINGS.each do |deprecation|
RSpec::Matchers.define "have_deprecated_#{deprecation}" do
diff --git a/spec/watirspec/window_switching_spec.rb b/spec/watirspec/window_switching_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/watirspec/window_switching_spec.rb
+++ b/spec/watirspec/window_switching_spec.rb
@@ -46,7 +46,13 @@ describe 'Browser' do
end
it 'finds window by :index' do
- w = browser.window(index: 1).use
+ expect {
+ expect(browser.window(index: 1).use).to be_kind_of(Watir::Window)
+ }.to have_deprecated_window_index
+ end
+
+ it 'finds window by multiple values' do
+ w = browser.window(url: /closeable\.html/, title: 'closeable window').use
expect(w).to be_kind_of(Watir::Window)
end
@@ -85,7 +91,9 @@ describe 'Browser' do
end
it "raises a NoMatchingWindowFoundException error if there's no window at the given index" do
- expect { browser.window(index: 100).use }.to raise_no_matching_window_exception
+ expect {
+ expect { browser.window(index: 100).use }.to raise_no_matching_window_exception
+ }.to have_deprecated_window_index
end
it 'raises NoMatchingWindowFoundException error when attempting to use a window with an incorrect handle' do
@@ -282,6 +290,7 @@ describe 'Window' do
end
end
end
+
describe '#current?' do
it 'returns false if the referenced window is closed' do
original_window = browser.window
@@ -388,7 +397,9 @@ describe 'Window' do
describe '#present?' do
it 'should find window by index' do
- expect(browser.window(index: 0)).to be_present
+ expect {
+ expect(browser.window(index: 0)).to be_present
+ }.to have_deprecated_window_index
end
it 'should find window by url' do
@@ -403,7 +414,7 @@ describe 'Window' do
describe '#use' do
context 'switching windows without blocks' do
it 'by index' do
- browser.window(index: 0).use
+ expect { browser.window(index: 0).use }.to have_deprecated_window_index
expect(browser.title).to be == 'window switching'
end
@@ -420,7 +431,9 @@ describe 'Window' do
context 'Switching windows with blocks' do
it 'by index' do
- browser.window(index: 0).use { expect(browser.title).to be == 'window switching' }
+ expect {
+ browser.window(index: 0).use { expect(browser.title).to be == 'window switching' }
+ }.to have_deprecated_window_index
end
it 'by url' do
|
deprecate locating windows by index
|
watir_watir
|
train
|
470bf2d44b1af645bdb30de42dbcff491aae14bf
|
diff --git a/src/test/java/org/webdriverextensions/ExamplesPageTest.java b/src/test/java/org/webdriverextensions/ExamplesPageTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/webdriverextensions/ExamplesPageTest.java
+++ b/src/test/java/org/webdriverextensions/ExamplesPageTest.java
@@ -23,7 +23,7 @@ public class ExamplesPageTest extends SiteAwareRepository {
public void before() {
open(site.url);
open(examplesPage);
- assertCurrentUrlEndsWith("/webdriverextensions/index.html");
+ assertCurrentUrlEndsWith("/webdriverextensions/model-test.html");
}
@After
diff --git a/src/test/java/org/webdriverextensions/WebRepositoryTest.java b/src/test/java/org/webdriverextensions/WebRepositoryTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/webdriverextensions/WebRepositoryTest.java
+++ b/src/test/java/org/webdriverextensions/WebRepositoryTest.java
@@ -27,8 +27,8 @@ public class WebRepositoryTest extends WebRepository {
@Before
public void before() {
- open("http://webdriverextensions.github.com/webdriverextensions/index.html");
- assertCurrentUrlEndsWith("/webdriverextensions/index.html");
+ open("http://webdriverextensions.github.com/webdriverextensions/model-test.html");
+ assertCurrentUrlEndsWith("/webdriverextensions/model-test.html");
}
@After
diff --git a/src/test/java/org/webdriverextensions/page/ExamplesPage.java b/src/test/java/org/webdriverextensions/page/ExamplesPage.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/webdriverextensions/page/ExamplesPage.java
+++ b/src/test/java/org/webdriverextensions/page/ExamplesPage.java
@@ -46,7 +46,7 @@ public class ExamplesPage extends WebPage<WebDriverExtensionSite> {
@Override
public void open() {
- getDriver().get("http://webdriverextensions.github.com/webdriverextensions/index.html");
+ getDriver().get("http://webdriverextensions.github.com/webdriverextensions/model-test.html");
}
@Override
diff --git a/src/test/java/org/webdriverextensions/page/HomePage.java b/src/test/java/org/webdriverextensions/page/HomePage.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/webdriverextensions/page/HomePage.java
+++ b/src/test/java/org/webdriverextensions/page/HomePage.java
@@ -16,7 +16,7 @@ public class HomePage extends WebPage<WebDriverExtensionSite> {
@Override
public void open() {
- getDriver().get("http://webdriverextensions.github.com/webdriverextensions/index.html");
+ getDriver().get("http://webdriverextensions.github.com/webdriverextensions/model-test.html");
}
@Override
diff --git a/src/test/java/org/webdriverextensions/page/LoginPage.java b/src/test/java/org/webdriverextensions/page/LoginPage.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/webdriverextensions/page/LoginPage.java
+++ b/src/test/java/org/webdriverextensions/page/LoginPage.java
@@ -46,7 +46,7 @@ public class LoginPage extends WebPage<AnotherSite> {
@Override
public void open() {
- getDriver().get("http://webdriverextensions.github.com/webdriverextensions/index.html");
+ getDriver().get("http://webdriverextensions.github.com/webdriverextensions/model-test.html");
}
@Override
diff --git a/src/test/java/org/webdriverextensions/site/AnotherSite.java b/src/test/java/org/webdriverextensions/site/AnotherSite.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/webdriverextensions/site/AnotherSite.java
+++ b/src/test/java/org/webdriverextensions/site/AnotherSite.java
@@ -5,7 +5,7 @@ import org.webdriverextensions.generator.annotations.Generate;
@Generate
public class AnotherSite extends AbstractAnotherSite {
- public String url = "http://webdriverextensions.github.com/webdriverextensions";
+ public String url = "http://webdriverextensions.github.com/webdriverextensions/model-test.html";
@Override
public void open() {
diff --git a/src/test/java/org/webdriverextensions/site/WebDriverExtensionSite.java b/src/test/java/org/webdriverextensions/site/WebDriverExtensionSite.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/webdriverextensions/site/WebDriverExtensionSite.java
+++ b/src/test/java/org/webdriverextensions/site/WebDriverExtensionSite.java
@@ -5,7 +5,7 @@ import org.webdriverextensions.generator.annotations.Generate;
@Generate(name = "site")
public class WebDriverExtensionSite extends AbstractSite {
- public String url = "http://webdriverextensions.github.com/webdriverextensions";
+ public String url = "http://webdriverextensions.github.com/webdriverextensions/model-test.html";
@Override
public void open() {
|
Updated model tests url to renamed model-test.html
|
webdriverextensions_webdriverextensions
|
train
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.