diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/lib/hacks/gradient.js b/lib/hacks/gradient.js
index <HASH>..<HASH> 100644
--- a/lib/hacks/gradient.js
+++ b/lib/hacks/gradient.js
@@ -125,6 +125,10 @@ class Gradient extends Value {
if (params[0].value === 'to') {
return params;
}
+ /* reset the search index of the global regex object, otherwise the next use
+ * will start the search for a match at the index where the search ended this time.
+ */
+ isDirection.lastIndex = 0;
if (!isDirection.test(params[0].value)) {
return params;
}
|
Bugfix reuse of global RegEx object. (#<I>)
When the same global regex object is used, you need to reset the lastIndex property.
|
diff --git a/goatools/test_data/optional_attrs.py b/goatools/test_data/optional_attrs.py
index <HASH>..<HASH> 100755
--- a/goatools/test_data/optional_attrs.py
+++ b/goatools/test_data/optional_attrs.py
@@ -182,7 +182,7 @@ class OptionalAttrs(object):
# level namespace depth parents children _parents
exp_flds = self.exp_req.union(self.exp_gen)
for goobj in self.go2obj.values():
- assert not set(vars(goobj).keys()).difference(exp_flds)
+ assert set(vars(goobj).keys()).difference(exp_flds) == set(['alt_ids'])
# print(vars(goobj).keys())
# print(" ".join(vars(goobj).keys()))
|
alt_ids expected in GOTerm
|
diff --git a/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTableRenderer.java b/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTableRenderer.java
index <HASH>..<HASH> 100755
--- a/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTableRenderer.java
+++ b/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTableRenderer.java
@@ -149,7 +149,10 @@ final class WTableRenderer extends AbstractWebXmlRenderer {
boolean multiple = table.getSelectMode() == SelectMode.MULTIPLE;
xml.appendTagOpen("ui:rowSelection");
xml.appendOptionalAttribute("multiple", multiple, "true");
- xml.appendOptionalAttribute("toggle", table.getToggleSubRowSelection(), "true");
+
+ boolean toggleSubRows = multiple && table.getToggleSubRowSelection() &&
+ WTable.ExpandMode.NONE != table.getExpandMode();
+ xml.appendOptionalAttribute("toggle", toggleSubRows, "true");
if (multiple) {
switch (table.getSelectAllMode()) {
case CONTROL:
|
Enhanced renderer
Added more constraints around when WTableRenderer outputs the toggle
attribute on ui:rowSelection. Part of #<I>
|
diff --git a/main/core/Library/Mailing/Validator.php b/main/core/Library/Mailing/Validator.php
index <HASH>..<HASH> 100644
--- a/main/core/Library/Mailing/Validator.php
+++ b/main/core/Library/Mailing/Validator.php
@@ -24,6 +24,13 @@ class Validator
const INVALID_ENCRYPTION = 'invalid_encryption';
const INVALID_AUTH_MODE = 'invalid_auth_mode';
+ public function checkIsPositiveNumber($value)
+ {
+ if (!is_numeric($value) || (int) $value < 0) {
+ return static::NUMBER_EXPECTED;
+ }
+ }
+
public function checkIsNotBlank($value)
{
if (empty($value)) {
|
[CoreBundle] Add missing mail validation method. (#<I>)
* [CoreBundle] Add missing mail validation method.
* Update Validator.php
|
diff --git a/test/test-helper.js b/test/test-helper.js
index <HASH>..<HASH> 100644
--- a/test/test-helper.js
+++ b/test/test-helper.js
@@ -1117,16 +1117,21 @@ helper.ccm.start = function (nodeLength, options) {
helper.ccm.bootstrapNode = function (nodeIndex, callback) {
const ipPrefix = helper.ipPrefix;
helper.trace('bootstrapping node', nodeIndex);
- helper.ccm.exec([
+ const ccmArgs = [
'add',
'node' + nodeIndex,
'-i',
ipPrefix + nodeIndex,
'-j',
(7000 + 100 * nodeIndex).toString(),
- '-b',
- '--dse'
- ], callback);
+ '-b'
+ ];
+
+ if (helper.getServerInfo().isDse) {
+ ccmArgs.push('--dse');
+ }
+
+ helper.ccm.exec(ccmArgs, callback);
};
helper.ccm.decommissionNode = function (nodeIndex, callback) {
|
Test: fix bootstrapping with C*
|
diff --git a/src/main/java/com/chalup/microorm/MicroOrm.java b/src/main/java/com/chalup/microorm/MicroOrm.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/chalup/microorm/MicroOrm.java
+++ b/src/main/java/com/chalup/microorm/MicroOrm.java
@@ -105,6 +105,18 @@ public class MicroOrm {
return result;
}
+ /**
+ * Returns an array containing column names needed by {@link MicroOrm} to
+ * successfully create an object of the specified type from {@link Cursor}.
+ *
+ * @param klass The {@link Class} of the object, for which the projection
+ * should be generated
+ * @return the {@link String[]} containing column names
+ */
+ public <T> String[] getProjection(Class<T> klass) {
+ return null;
+ }
+
@SuppressWarnings("unchecked")
private <T> DaoAdapter<T> getAdapter(Class<T> klass) {
DaoAdapter<?> cached = mDaoAdapterCache.get(klass);
|
Added MicroOrm.getProjection() method to public API
|
diff --git a/app/models/concerns/genkan/auth.rb b/app/models/concerns/genkan/auth.rb
index <HASH>..<HASH> 100644
--- a/app/models/concerns/genkan/auth.rb
+++ b/app/models/concerns/genkan/auth.rb
@@ -44,7 +44,7 @@ module Genkan
end
def banned?
- self.banned_at.present?
+ banned_at.present?
end
def ban
|
Refactored Genkan::Auth
|
diff --git a/uPortal-security/uPortal-security-authn/src/main/java/org/apereo/portal/security/provider/SimpleSecurityContext.java b/uPortal-security/uPortal-security-authn/src/main/java/org/apereo/portal/security/provider/SimpleSecurityContext.java
index <HASH>..<HASH> 100644
--- a/uPortal-security/uPortal-security-authn/src/main/java/org/apereo/portal/security/provider/SimpleSecurityContext.java
+++ b/uPortal-security/uPortal-security-authn/src/main/java/org/apereo/portal/security/provider/SimpleSecurityContext.java
@@ -54,10 +54,10 @@ public class SimpleSecurityContext extends ChainingSecurityContext implements IS
if (this.myPrincipal.UID != null && this.myOpaqueCredentials.credentialstring != null) {
// Logs if an attempt is made to log into a local account
- StringBuilder msg = new StringBuilder();
- msg.append("An attempt to log into the local login has occurred. ");
- msg.append("user=" + this.myPrincipal.UID);
- if (log.isWarnEnabled()) log.warn(msg.toString());
+ if (log.isWarnEnabled())
+ log.warn(
+ "An attempt to log into the local login has occurred. user="
+ + this.myPrincipal.UID);
try {
|
Cleaned up code and moved message into if statement
|
diff --git a/src/xopen/__init__.py b/src/xopen/__init__.py
index <HASH>..<HASH> 100644
--- a/src/xopen/__init__.py
+++ b/src/xopen/__init__.py
@@ -189,7 +189,7 @@ class PipedCompressionWriter(Closing):
)
# TODO use a context manager
- self.outfile = open(path, mode)
+ self.outfile = open(path, mode[0] + "b")
self.closed: bool = False
self.name: str = str(os.fspath(path))
self._mode: str = mode
|
Open output file for piping in binary mode
This avoids an EncodingWarning that was previously raised when opening the
file in text mode. For Popen, we only need something that has a fileno()
method and encoding or whether the file was opened in text mode at all is
ignored anyway.
Encoding and text mode are taken care of separately when writing into the
process.
|
diff --git a/payment/src/main/java/org/killbill/billing/payment/core/janitor/CompletionTaskBase.java b/payment/src/main/java/org/killbill/billing/payment/core/janitor/CompletionTaskBase.java
index <HASH>..<HASH> 100644
--- a/payment/src/main/java/org/killbill/billing/payment/core/janitor/CompletionTaskBase.java
+++ b/payment/src/main/java/org/killbill/billing/payment/core/janitor/CompletionTaskBase.java
@@ -81,7 +81,8 @@ abstract class CompletionTaskBase<T> implements Runnable {
this.accountInternalApi = accountInternalApi;
this.pluginControlledPaymentAutomatonRunner = pluginControlledPaymentAutomatonRunner;
this.pluginRegistry = pluginRegistry;
- this.taskName = this.getClass().getName();
+ // Limit the length of the username in the context (limited to 50 characters)
+ this.taskName = this.getClass().getSimpleName();
this.completionTaskCallContext = internalCallContextFactory.createInternalCallContext((Long) null, (Long) null, taskName, CallOrigin.INTERNAL, UserType.SYSTEM, UUID.randomUUID());
}
|
payment: fix java.sql.SQLDataException in PendingTransactionTask
This fixes:
java.sql.SQLDataException: Data too long for column 'updated_by' at row 1
as updated_by was set to org.killbill.billing.payment.core.janitor.PendingTransactionTask,
which is longer than the updated_by column.
|
diff --git a/microcosm/loaders.py b/microcosm/loaders.py
index <HASH>..<HASH> 100644
--- a/microcosm/loaders.py
+++ b/microcosm/loaders.py
@@ -22,7 +22,7 @@ def expand_config(dct,
skip_to=0,
key_func=lambda key: key.lower(),
key_parts_filter=lambda key_parts: True,
- value_func=lambda value: value() if callable(value) else value):
+ value_func=lambda value: value):
"""
Expand a dictionary recursively by splitting keys along the separator.
diff --git a/microcosm/tests/test_loaders.py b/microcosm/tests/test_loaders.py
index <HASH>..<HASH> 100644
--- a/microcosm/tests/test_loaders.py
+++ b/microcosm/tests/test_loaders.py
@@ -65,6 +65,7 @@ def test_expand_config():
},
key_parts_filter=lambda key_parts: key_parts[0] == "prefix",
skip_to=1,
+ value_func=lambda value: value() if callable(value) else value,
),
is_(equal_to(
{
|
Don't evaluate values as callable by default
|
diff --git a/salt/modules/publish.py b/salt/modules/publish.py
index <HASH>..<HASH> 100644
--- a/salt/modules/publish.py
+++ b/salt/modules/publish.py
@@ -111,8 +111,6 @@ def _publish(
return cret
else:
return ret
- if (loop_interval * loop_counter) > timeout:
- return {}
loop_counter = loop_counter + 1
time.sleep(loop_interval)
else:
|
Removing some redundant code. This was moved to be above the loop exit
|
diff --git a/graylog2-server/src/main/java/org/graylog/plugins/views/search/export/es/SearchAfter.java b/graylog2-server/src/main/java/org/graylog/plugins/views/search/export/es/SearchAfter.java
index <HASH>..<HASH> 100644
--- a/graylog2-server/src/main/java/org/graylog/plugins/views/search/export/es/SearchAfter.java
+++ b/graylog2-server/src/main/java/org/graylog/plugins/views/search/export/es/SearchAfter.java
@@ -33,7 +33,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
-import static jersey.repackaged.com.google.common.collect.Lists.newArrayList;
+import static com.google.common.collect.Lists.newArrayList;
import static org.graylog2.plugin.streams.Stream.DEFAULT_EVENT_STREAM_IDS;
public class SearchAfter implements RequestStrategy {
|
Fixed import (#<I>)
|
diff --git a/openpnm/models/geometry/pore_volume.py b/openpnm/models/geometry/pore_volume.py
index <HASH>..<HASH> 100644
--- a/openpnm/models/geometry/pore_volume.py
+++ b/openpnm/models/geometry/pore_volume.py
@@ -148,8 +148,9 @@ def effective(target, pore_volume='pore.volume',
cn = network['throat.conns']
P1 = cn[:, 0]
P2 = cn[:, 1]
- eff_vol = np.copy(target[pore_volume])
- np.add.at(eff_vol, P1, 1/2*target[throat_volume])
- np.add.at(eff_vol, P2, 1/2*target[throat_volume])
- value = eff_vol
+ eff_vol = np.copy(network[pore_volume])
+ np.add.at(eff_vol, P1, 1/2*network[throat_volume])
+ np.add.at(eff_vol, P2, 1/2*network[throat_volume])
+ pores = network.map_pores(throats=target.Ps, origin=target)
+ value = eff_vol[pores]
return value
|
Corrected for case where target object spans sub domain
|
diff --git a/core/server/src/main/java/alluxio/worker/netty/BlockDataServerHandler.java b/core/server/src/main/java/alluxio/worker/netty/BlockDataServerHandler.java
index <HASH>..<HASH> 100644
--- a/core/server/src/main/java/alluxio/worker/netty/BlockDataServerHandler.java
+++ b/core/server/src/main/java/alluxio/worker/netty/BlockDataServerHandler.java
@@ -82,8 +82,8 @@ final class BlockDataServerHandler {
BlockReader reader = null;
DataBuffer buffer;
try {
- reader = mWorker.readBlockRemote(sessionId, blockId, lockId);
req.validate();
+ reader = mWorker.readBlockRemote(sessionId, blockId, lockId);
final long fileLength = reader.getLength();
validateBounds(req, fileLength);
final long readLength = returnLength(offset, len, fileLength);
|
Validate request before reading a remote block
|
diff --git a/Eloquent/Concerns/QueriesRelationships.php b/Eloquent/Concerns/QueriesRelationships.php
index <HASH>..<HASH> 100644
--- a/Eloquent/Concerns/QueriesRelationships.php
+++ b/Eloquent/Concerns/QueriesRelationships.php
@@ -414,7 +414,10 @@ trait QueriesRelationships
preg_replace('/[^[:alnum:][:space:]_]/u', '', "$name $function $column")
);
- $this->selectSub($query->limit(1), $alias);
+ $this->selectSub(
+ $function ? $query : $query->limit(1),
+ $alias
+ );
}
return $this;
|
Fix withAggregate issue caused by limit 1 for aggregation functions (#<I>)
|
diff --git a/salt/utils/__init__.py b/salt/utils/__init__.py
index <HASH>..<HASH> 100644
--- a/salt/utils/__init__.py
+++ b/salt/utils/__init__.py
@@ -1029,17 +1029,18 @@ def fopen(*args, **kwargs):
return flopen(*args, **kwargs)
# ensure 'binary' mode is always used on windows
- if is_windows():
- if len(args) > 1:
- args = list(args)
- if 'b' not in args[1]:
- args[1] += 'b'
- elif kwargs.get('mode', None):
- if 'b' not in kwargs['mode']:
- kwargs['mode'] += 'b'
- else:
- # the default is to read
- kwargs['mode'] = 'rb'
+ if kwargs.pop('binary', True):
+ if is_windows():
+ if len(args) > 1:
+ args = list(args)
+ if 'b' not in args[1]:
+ args[1] += 'b'
+ elif kwargs.get('mode', None):
+ if 'b' not in kwargs['mode']:
+ kwargs['mode'] += 'b'
+ else:
+ # the default is to read
+ kwargs['mode'] = 'rb'
fhandle = open(*args, **kwargs)
if is_fcntl_available():
|
allow override of binary file mode on windows
Related to #<I>.
|
diff --git a/src/Core/Checkout/Cart/SalesChannel/CartOrderRoute.php b/src/Core/Checkout/Cart/SalesChannel/CartOrderRoute.php
index <HASH>..<HASH> 100644
--- a/src/Core/Checkout/Cart/SalesChannel/CartOrderRoute.php
+++ b/src/Core/Checkout/Cart/SalesChannel/CartOrderRoute.php
@@ -69,10 +69,13 @@ class CartOrderRoute extends AbstractCartOrderRoute
* @OA\Post(
* path="/checkout/order",
* summary="Create an order from a cart",
- * description="Creates a new order from the current cart and deletes the cart.",
+ * description="Creates a new order from the current cart and deletes the cart.
+
+If you are using the [prepared payment flow](https://developer.shopware.com/docs/concepts/commerce/checkout-concept/payments#2.1-prepare-payment-optional), this endpoint also receives additional transaction details. The exact name of the parameters depends on the implementation of the corresponding *payment handler*.",
* operationId="createOrder",
* tags={"Store API", "Order"},
* @OA\RequestBody(
+ * description="Contains additional metadata which is stored together with the order. It can also contain payment transaction details.",
* @OA\JsonContent(
* @OA\Property(
* property="customerComment",
|
NEXT-<I> - Added reference to prepared payments in order endpoint description.
|
diff --git a/dbkit.py b/dbkit.py
index <HASH>..<HASH> 100644
--- a/dbkit.py
+++ b/dbkit.py
@@ -428,7 +428,10 @@ class ThreadAffinePool(PoolBase):
# collector kicks in while the starved threads are waiting, this means
# they'll have a chance to grab a connection.
- __slots__ = ('_cond', '_starved', '_max_conns', '_allocated', '_connect')
+ __slots__ = (
+ '_cond', '_starved', '_local',
+ '_max_conns', '_allocated',
+ '_connect')
def __init__(self, module, max_conns, *args, **kwargs):
try:
|
Add _local to the slots.
|
diff --git a/lib/guard/interactors/readline.rb b/lib/guard/interactors/readline.rb
index <HASH>..<HASH> 100644
--- a/lib/guard/interactors/readline.rb
+++ b/lib/guard/interactors/readline.rb
@@ -49,10 +49,10 @@ module Guard
#
def stop
# Erase the current line for Ruby Readline
- if Readline.respond_to?(:refresh_line)
+ if Readline.respond_to?(:refresh_line) && !defined(JRUBY_VERSION)
Readline.refresh_line
end
-
+
# Erase the current line for Rb-Readline
if defined?(RbReadline) && RbReadline.rl_outstream
RbReadline._rl_erase_entire_line
@@ -60,7 +60,7 @@ module Guard
super
end
-
+
# Read a line from stdin with Readline.
#
def read_line
|
Skip Readline.refresh_line on JRUBY. (Closes #<I>)
|
diff --git a/examples/terran/mass_reaper.py b/examples/terran/mass_reaper.py
index <HASH>..<HASH> 100644
--- a/examples/terran/mass_reaper.py
+++ b/examples/terran/mass_reaper.py
@@ -113,7 +113,7 @@ class MassReaperBot(sc2.BotAI):
continue # continue for loop, dont execute any of the following
# attack is on cooldown, check if grenade is on cooldown, if not then throw it to furthest enemy in range 5
- reaperGrenadeRange = self._game_data.abilities[Abi lityId.D8CHARGE_KD8CHARGE.value]._proto.cast_range
+ reaperGrenadeRange = self._game_data.abilities[AbilityId.D8CHARGE_KD8CHARGE.value]._proto.cast_range
enemyGroundUnitsInGrenadeRange = self.known_enemy_units.not_structure.not_flying.exclude_type([LARVA, EGG]).closer_than(reaperGrenadeRange, r)
if enemyGroundUnitsInGrenadeRange.exists and (r.is_attacking or r.is_moving):
# if AbilityId.KD8CHARGE_KD8CHARGE in abilities, we check that to see if the reaper grenade is off cooldown
|
Fix typo in "AbilityId" name
|
diff --git a/src/lib/KevinGH/Box/Command/Info.php b/src/lib/KevinGH/Box/Command/Info.php
index <HASH>..<HASH> 100644
--- a/src/lib/KevinGH/Box/Command/Info.php
+++ b/src/lib/KevinGH/Box/Command/Info.php
@@ -146,27 +146,24 @@ HELP
$indent,
$base
) {
+ /** @var SplFileInfo[] $list */
foreach ($list as $item) {
- /** @var $item SplFileInfo */
-
if (false !== $indent) {
$output->write(str_repeat(' ', $indent));
+ $path = $item->getFilename();
+
if ($item->isDir()) {
- $output->writeln(
- '<info>' . $item->getFilename() . '/</info>'
- );
- } else {
- $output->writeln($item->getFilename());
+ $path .= '/';
}
} else {
$path = str_replace($base, '', $item->getPathname());
+ }
- if ($item->isDir()) {
- $output->writeln("<info>$path</info>");
- } else {
- $output->writeln($path);
- }
+ if ($item->isDir()) {
+ $output->writeln("<info>$path</info>");
+ } else {
+ $output->writeln($path);
}
if ($item->isDir()) {
|
Consolidating render for future compression information addition.
|
diff --git a/tests/mapping.js b/tests/mapping.js
index <HASH>..<HASH> 100644
--- a/tests/mapping.js
+++ b/tests/mapping.js
@@ -16,6 +16,7 @@ var objectFns = [
"updateAccount",
"updateCampaign",
"addCertificate",
+ "addDeveloperCertificate",
"updateCertificate",
"listDeviceLogs",
"listMetrics",
@@ -88,7 +89,8 @@ exports.mapArgs = (module, method, query) => {
// Transform query to json string
query = query
.replace(/&/g, '","')
- .replace(/=/g, '":"');
+ .replace(/=/g, '":"')
+ .replace(/\+/g, ' ');
query = `{"${decodeURIComponent(query)}"}`;
@@ -97,7 +99,7 @@ exports.mapArgs = (module, method, query) => {
.replace(/"\[/g, '[')
.replace(/\}"/g, '}')
.replace(/"\{/g, '{')
- .replace(/\+/g, ' ');
+ .replace(/\n/g, '\\n');
// Use a reviver to camel-case the JSON
args = JSON.parse(query, function(key, value) {
@@ -106,6 +108,7 @@ exports.mapArgs = (module, method, query) => {
if (snakey === key) return value;
this[snakey] = value;
});
+
} catch(e) {
console.log(e);
return [];
|
Test fixe (#<I>)
* Fixed newlines in data being passed to tests
* Added addDeveloperCertificate object mapping
|
diff --git a/tests/FileManipulation/UndefinedVariableManipulationTest.php b/tests/FileManipulation/UndefinedVariableManipulationTest.php
index <HASH>..<HASH> 100644
--- a/tests/FileManipulation/UndefinedVariableManipulationTest.php
+++ b/tests/FileManipulation/UndefinedVariableManipulationTest.php
@@ -1,8 +1,6 @@
<?php
namespace Psalm\Tests\FileManipulation;
-use const PHP_VERSION;
-
class UndefinedVariableManipulationTest extends FileManipulationTestCase
{
/**
@@ -136,7 +134,7 @@ class UndefinedVariableManipulationTest extends FileManipulationTestCase
new D();
}',
- PHP_VERSION,
+ '7.4',
[],
true,
],
|
Prevent failures with dev PHP versions
It was failing with dev versions, e.g. `<I>-dev`
|
diff --git a/lib/subdomain_locale/controller.rb b/lib/subdomain_locale/controller.rb
index <HASH>..<HASH> 100644
--- a/lib/subdomain_locale/controller.rb
+++ b/lib/subdomain_locale/controller.rb
@@ -1,13 +1,14 @@
module SubdomainLocale
module Controller
def self.included(base)
- base.before_filter :set_locale
+ base.around_filter :set_locale
end
private
def set_locale
- I18n.locale = SubdomainLocale.mapping.locale_for(request.subdomain)
+ locale = SubdomainLocale.mapping.locale_for(request.subdomain)
+ I18n.with_locale(locale) { yield }
end
end
end
diff --git a/test/rails_test.rb b/test/rails_test.rb
index <HASH>..<HASH> 100644
--- a/test/rails_test.rb
+++ b/test/rails_test.rb
@@ -39,6 +39,12 @@ class HelloControllerTest < ActionController::TestCase
assert_select "p", "Привіт"
end
+ def test_locale_after_action
+ @request.host = "ru.example.com"
+ get :world
+ assert_equal :en, I18n.locale
+ end
+
def test_other
@request.host = "wtf.example.com"
assert_raise(I18n::InvalidLocale) do
|
Controller action should revert global locale afterwards.
|
diff --git a/src/wa_kat/zeo/request_info.py b/src/wa_kat/zeo/request_info.py
index <HASH>..<HASH> 100755
--- a/src/wa_kat/zeo/request_info.py
+++ b/src/wa_kat/zeo/request_info.py
@@ -106,6 +106,16 @@ def _get_req_mapping():
)
+class Progress(namedtuple("Progress", ["done", "base"])):
+ """
+ Progress bar representation.
+
+ Attr:
+ done (int): How much is done.
+ base (int): How much is there.
+ """
+
+
@total_ordering
class RequestInfo(Persistent):
"""
@@ -211,9 +221,12 @@ class RequestInfo(Persistent):
Get progress.
Returns:
- tuple: (int(done), int(how_many))
+ namedtuple: :class:`Progress`.
"""
- return len(self._get_all_set_properties()), len(_get_req_mapping())
+ return Progress(
+ done=len(self._get_all_set_properties()),
+ base=len(_get_req_mapping()),
+ )
def is_all_set(self):
"""
|
#<I>: Added more human-readable progress tracking.
|
diff --git a/core/src/main/java/net/kuujo/copycat/internal/PassiveState.java b/core/src/main/java/net/kuujo/copycat/internal/PassiveState.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/net/kuujo/copycat/internal/PassiveState.java
+++ b/core/src/main/java/net/kuujo/copycat/internal/PassiveState.java
@@ -110,13 +110,15 @@ public class PassiveState extends AbstractState {
// Get a list of entries up to 1MB in size.
List<ByteBuffer> entries = new ArrayList<>(1024);
- long index = member.getIndex();
- int size = 0;
- while (size < 1024 * 1024 && index < context.getCommitIndex()) {
- ByteBuffer entry = context.log().getEntry(index);
- size += entry.limit();
- entries.add(entry);
- index++;
+ if (!context.log().isEmpty()) {
+ long index = Math.max(member.getIndex(), context.log().lastIndex());
+ int size = 0;
+ while (size < 1024 * 1024 && index < context.getCommitIndex()) {
+ ByteBuffer entry = context.log().getEntry(index);
+ size += entry.limit();
+ entries.add(entry);
+ index++;
+ }
}
syncHandler.handle(SyncRequest.builder()
|
Handle missing entries due to log compaction in gossip-based replication.
|
diff --git a/opal/browser/dom/event.rb b/opal/browser/dom/event.rb
index <HASH>..<HASH> 100644
--- a/opal/browser/dom/event.rb
+++ b/opal/browser/dom/event.rb
@@ -40,6 +40,8 @@ class Event < Native
def stopped?; !!@stopped; end
def stop!
+ `#@native.stopPropagation()` if `#@native.stopPropagation`
+
@stopped = true
end
end
|
dom/event: call stopPropagation
|
diff --git a/drizzlepac/haputils/catalog_utils.py b/drizzlepac/haputils/catalog_utils.py
index <HASH>..<HASH> 100755
--- a/drizzlepac/haputils/catalog_utils.py
+++ b/drizzlepac/haputils/catalog_utils.py
@@ -935,6 +935,10 @@ class HAPPointCatalog(HAPCatalogBase):
# Perform manual detection of sources using theoretical PSFs
# Initial test data: ictj65
try:
+ # Subtract the detection threshold image so that detection is anything > 0
+ region -= (reg_rms * self.param_dict['nsigma'])
+ # insure no negative values for deconvolution
+ region = np.clip(region, 0., region.max())
user_peaks, source_fwhm = decutils.find_point_sources(self.image.imgname,
data=region,
def_fwhm=source_fwhm,
|
Adjust threshold for point-catalog generation (#<I>)
* Adjust threshold for PSF source finding
* Remove errant neg sign
|
diff --git a/src/Models/BaseEmailServiceConfigModel.php b/src/Models/BaseEmailServiceConfigModel.php
index <HASH>..<HASH> 100644
--- a/src/Models/BaseEmailServiceConfigModel.php
+++ b/src/Models/BaseEmailServiceConfigModel.php
@@ -43,6 +43,9 @@ class BaseEmailServiceConfigModel extends BaseServiceConfigModel
throw new BadRequestException('Web service parameters must be an array.');
}
EmailServiceParameterConfig::setConfig($id, $params);
+ unset($config['parameters']);
}
+
+ parent::setConfig($id, $config);
}
}
\ No newline at end of file
|
DF-<I> #resolve #comment Fixed SMTP as well other could based email service config not saving issue
|
diff --git a/apiserver/facades/client/highavailability/highavailability.go b/apiserver/facades/client/highavailability/highavailability.go
index <HASH>..<HASH> 100644
--- a/apiserver/facades/client/highavailability/highavailability.go
+++ b/apiserver/facades/client/highavailability/highavailability.go
@@ -232,6 +232,14 @@ func validatePlacementForSpaces(st *state.State, spaces *[]string, placement []s
for _, v := range placement {
p, err := instance.ParsePlacement(v)
if err != nil {
+ if err == instance.ErrPlacementScopeMissing {
+ // Where an unscoped placement is not parsed as a machine ID,
+ // such as for a MaaS node name, just allow it through.
+ // TODO (manadart 2018-03-27): Possible work at the provider
+ // level to accommodate placement and space constraints during
+ // instance pre-check may be entertained in the future.
+ continue
+ }
return errors.Annotate(err, "parsing placement")
}
if p.Directive == "" {
|
Allows unscoped placement directives to proceed without parsing error or space validation.
|
diff --git a/xero/basemanager.py b/xero/basemanager.py
index <HASH>..<HASH> 100644
--- a/xero/basemanager.py
+++ b/xero/basemanager.py
@@ -326,6 +326,7 @@ class BaseManager(object):
elif parts[1] in ["isnull"]:
sign = '=' if value else '!'
return '%s%s=null' % (parts[0], sign)
+ field = field.replace('_', '.')
return fmt % (
field,
get_filter_params(key, value)
|
Fix incorrect field parsing with filters
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,7 @@ class tests(Command):
def run(self):
import subprocess
import sys
- for t in glob.glob('unitest*.py'):
+ for t in glob.glob('unitest.py'):
ret = subprocess.call([sys.executable, t]) != 0
if ret != 0:
raise SystemExit(ret)
|
API tests + requests in the setup.py script
|
diff --git a/src/language/lexer.js b/src/language/lexer.js
index <HASH>..<HASH> 100644
--- a/src/language/lexer.js
+++ b/src/language/lexer.js
@@ -187,9 +187,9 @@ function printCharCode(code) {
/**
* Gets the next token from the source starting at the given position.
*
- * This skips over whitespace and comments until it finds the next lexable
- * token, then lexes punctuators immediately or calls the appropriate helper
- * function for more complicated tokens.
+ * This skips over whitespace until it finds the next lexable token, then lexes
+ * punctuators immediately or calls the appropriate helper function for more
+ * complicated tokens.
*/
function readToken(lexer: Lexer<*>, prev: Token): Token {
const source = lexer.source;
@@ -362,8 +362,7 @@ function unexpectedCharacterMessage(code) {
/**
* Reads from body starting at startPosition until it finds a non-whitespace
- * or commented character, then returns the position of that character for
- * lexing.
+ * character, then returns the position of that character for lexing.
*/
function positionAfterWhitespace(
body: string,
|
Fix comments to reflex current behaviour (#<I>)
Lexer: Fix comments to reflex current behaviour
|
diff --git a/pykube/http.py b/pykube/http.py
index <HASH>..<HASH> 100644
--- a/pykube/http.py
+++ b/pykube/http.py
@@ -6,7 +6,7 @@ import yaml
from .exceptions import KubernetesError
-class APIClient(object):
+class HTTPClient(object):
def __init__(self, kubeconfig_path, cluster_name, user_name, url=None, namespace="default", version="v1"):
self.kubeconfig_path = kubeconfig_path
|
renamed APIClient
|
diff --git a/tests.py b/tests.py
index <HASH>..<HASH> 100644
--- a/tests.py
+++ b/tests.py
@@ -1826,6 +1826,9 @@ class FieldTypeTests(BasePeeweeTestCase):
self.assertSQLEqual(null_lookup.sql(), ('SELECT * FROM nullmodel WHERE char_field IS NULL', []))
self.assertEqual(list(null_lookup), [nm])
+
+ null_lookup = NullModel.select().where(~Q(char_field__is=None))
+ self.assertSQLEqual(null_lookup.sql(), ('SELECT * FROM nullmodel WHERE NOT char_field IS NULL', []))
non_null_lookup = NullModel.select().where(char_field='')
self.assertSQLEqual(non_null_lookup.sql(), ('SELECT * FROM nullmodel WHERE char_field = ?', ['']))
|
Showing how to do a not null lookup
|
diff --git a/manticore/platforms/linux.py b/manticore/platforms/linux.py
index <HASH>..<HASH> 100644
--- a/manticore/platforms/linux.py
+++ b/manticore/platforms/linux.py
@@ -1753,9 +1753,9 @@ class Linux(Platform):
self.sched()
self.running.remove(procid)
#self.procs[procid] = None
- logger.debug("EXIT_GROUP PROC_%02d %s", procid, error_code)
+ logger.debug("EXIT_GROUP PROC_%02d %s", procid, ctypes.c_int32(error_code).value)
if len(self.running) == 0 :
- raise TerminateState("Program finished with exit status: %r" % error_code, testcase=True)
+ raise TerminateState("Program finished with exit status: %r" % ctypes.c_int32(error_code).value, testcase=True)
return error_code
def sys_ptrace(self, request, pid, addr, data):
|
Manticore prints linux ret code as uint instead of int (#<I>)
* Fixing raise issue #<I>
* syncing git
* Fix Bug #<I>
* syncing
* removed all binaries
* missed one file
|
diff --git a/lib/chef/knife/container_docker_build.rb b/lib/chef/knife/container_docker_build.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/knife/container_docker_build.rb
+++ b/lib/chef/knife/container_docker_build.rb
@@ -190,7 +190,12 @@ class Chef
# Run a shell command from the Docker Context directory
#
def run_command(cmd)
- shell_out(cmd, cwd: docker_context)
+ Open3.popen2e(cmd, chdir: docker_context) do |stdin, stdout_err, wait_thr|
+ while line = stdout_err.gets
+ puts line
+ end
+ wait_thr.value.to_i
+ end
end
#
|
in order to show the output of commands that are run I am switching run_command to use Open3.
|
diff --git a/lib/resource/index.js b/lib/resource/index.js
index <HASH>..<HASH> 100644
--- a/lib/resource/index.js
+++ b/lib/resource/index.js
@@ -350,7 +350,7 @@ Resource = new Class({
, paginator
;
- objects = objects || [];
+ objects = objects || '[]';
objects = this.sort( JSON.parse( objects ) );
debug( 'paging' );
paginator = new this.options.paginator({
|
make sure default data from _get_list is a json string.
can't parse an object
|
diff --git a/pymagicc/io.py b/pymagicc/io.py
index <HASH>..<HASH> 100644
--- a/pymagicc/io.py
+++ b/pymagicc/io.py
@@ -963,7 +963,8 @@ class _TempOceanLayersOutReader(_Reader):
class _BinData(object):
def __init__(self, filepath):
# read the entire file into memory
- self.data = open(filepath, "rb").read()
+ with open(filepath, "rb") as fh:
+ self.data = fh.read()
self.data = memoryview(self.data)
self.pos = 0
|
Ensure that the open file is explicitly closed once read
|
diff --git a/collatex-pythonport/ClusterShell/RangeSet.py b/collatex-pythonport/ClusterShell/RangeSet.py
index <HASH>..<HASH> 100644
--- a/collatex-pythonport/ClusterShell/RangeSet.py
+++ b/collatex-pythonport/ClusterShell/RangeSet.py
@@ -30,6 +30,8 @@
# The fact that you are presently reading this means that you have had
# knowledge of the CeCILL-C license and that you accept its terms.
+# This class has been modified to make it Python 3 compliant by Ronald Haentjens Dekker
+
"""
Cluster range set module.
@@ -537,7 +539,13 @@ class RangeSet(set):
(I.e. all elements that are in both sets.)
"""
- return self._wrap_set_op(set.intersection, other)
+ #NOTE: This is a work around
+ # Python 3 return as the result of set.intersection a new set instance.
+ # Python 2 however returns as a the result a ClusterShell.RangeSet.RangeSet instance.
+ # ORIGINAL CODE: return self._wrap_set_op(set.intersection, other)
+ copy = self.copy()
+ copy.intersection_update(other)
+ return copy
def __xor__(self, other):
"""Return the symmetric difference of two RangeSets as a new RangeSet.
|
Implemented workaround to make intersection method of RangeSet class
work correctly with Python 3.
|
diff --git a/chisel/app.py b/chisel/app.py
index <HASH>..<HASH> 100644
--- a/chisel/app.py
+++ b/chisel/app.py
@@ -196,13 +196,15 @@ class Context(object):
self.log = logging.getLoggerClass()('')
self.log.setLevel(self.app.log_level)
wsgi_errors = environ.get('wsgi.errors')
- if wsgi_errors is not None:
+ if wsgi_errors is None:
+ handler = logging.NullHandler()
+ else:
handler = logging.StreamHandler(wsgi_errors)
- if hasattr(self.app.log_format, '__call__'):
- handler.setFormatter(self.app.log_format(self))
- else:
- handler.setFormatter(logging.Formatter(self.app.log_format))
- self.log.addHandler(handler)
+ if hasattr(self.app.log_format, '__call__'):
+ handler.setFormatter(self.app.log_format(self))
+ else:
+ handler.setFormatter(logging.Formatter(self.app.log_format))
+ self.log.addHandler(handler)
def start_response(self, status, headers):
return self._start_response(status, list(itertools.chain(headers, self.headers)))
|
Add null handler when wsgi.errors is None
|
diff --git a/lib/rester/client.rb b/lib/rester/client.rb
index <HASH>..<HASH> 100644
--- a/lib/rester/client.rb
+++ b/lib/rester/client.rb
@@ -96,11 +96,10 @@ module Rester
end
@_requester.on_close do
- logger.info("circuit closed")
+ _log_with_correlation_id(:info, "circuit closed for #{_producer_name}")
end
else
@_requester = proc { |*args| _request(*args) }
- _log_with_correlation_id(:info, "circuit closed for #{_producer_name}")
end
end
|
[#<I>] Fix merge mistake
|
diff --git a/src/hdnode.js b/src/hdnode.js
index <HASH>..<HASH> 100644
--- a/src/hdnode.js
+++ b/src/hdnode.js
@@ -243,6 +243,7 @@ HDNode.prototype.derive = function(index) {
}
// Private parent key -> private child key
+ var hd
if (this.privKey) {
// ki = parse256(IL) + kpar (mod n)
var ki = pIL.add(this.privKey.D).mod(ecparams.getN())
|
HDWallet: adds missing hd declaration
Only a problem if "use strict" is enforced
|
diff --git a/examples/cert_checker.py b/examples/cert_checker.py
index <HASH>..<HASH> 100644
--- a/examples/cert_checker.py
+++ b/examples/cert_checker.py
@@ -47,13 +47,13 @@ if __name__ == '__main__':
# Check if the certificate subject has any spoofed domains
subject = row['certificate.subject']
- domain = subject[3:] # Just chopping off the 'CN=' part
if any([domain in subject for domain in spoofed_domains]):
print('\n<<< Suspicious Certificate Found >>>')
pprint(row)
# Make a Virus Total query with the spoofed domain (just for fun)
- results = vtq.query_url(domain)
+ query_domain = subject[3:] # Just chopping off the 'CN=' part
+ results = vtq.query_url(query_domain)
if results.get('positives', 0) >= 2: # At least two hits
print('\n<<< Virus Total Query >>>')
pprint(results)
|
cleaning up some goofy code, thanks <URL>
|
diff --git a/peer.go b/peer.go
index <HASH>..<HASH> 100644
--- a/peer.go
+++ b/peer.go
@@ -114,8 +114,6 @@ type peer struct {
started int32
disconnect int32
- cfg *Config
-
// The following fields are only meant to be used *atomically*
bytesReceived uint64
bytesSent uint64
@@ -130,6 +128,8 @@ type peer struct {
// our last ping message. To be used atomically.
pingLastSend int64
+ cfg *Config
+
connReq *connmgr.ConnReq
conn net.Conn
|
peer: fix struct alignment
Integers used atomically MUST be aligned properly, otherwise the
sync library will crash on purpose. Therefore non-aligned struct
members must come later.
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,7 @@ except ImportError:
else:
if not os.path.exists(swagger_ui.STATIC_DIR):
swagger_ui.setup_ui('2.2.10')
- swagger_ui.setup_ui('3.14.1')
+ swagger_ui.setup_ui('3.17.2')
with open(os.path.join(os.path.abspath(os.path.dirname(
diff --git a/swagger_ui.py b/swagger_ui.py
index <HASH>..<HASH> 100755
--- a/swagger_ui.py
+++ b/swagger_ui.py
@@ -22,6 +22,7 @@ TEMPLATES_DIR = os.path.join(DIR, PACKAGE, 'templates', 'swagger-ui')
PREFIX = '{{static_prefix}}'
REPLACE_STRINGS = [
('http://petstore.swagger.io/v2/swagger.json', '{{url}}'),
+ ('https://petstore.swagger.io/v2/swagger.json', '{{url}}'),
('href="images', 'href="' + PREFIX + 'images'),
('src="images', 'src="' + PREFIX + 'images'),
("href='css", "href='" + PREFIX + 'css'),
|
bump swagger-ui to <I>
|
diff --git a/app/Module/SlideShowModule.php b/app/Module/SlideShowModule.php
index <HASH>..<HASH> 100644
--- a/app/Module/SlideShowModule.php
+++ b/app/Module/SlideShowModule.php
@@ -27,6 +27,7 @@ use Illuminate\Database\Query\JoinClause;
use Illuminate\Support\Str;
use Psr\Http\Message\ServerRequestInterface;
use function app;
+use function in_array;
/**
* Class SlideShowModule
@@ -87,6 +88,11 @@ class SlideShowModule extends AbstractModule implements ModuleBlockInterface
$media_types = array_filter($media_types);
+ // The type "other" includes media without a type.
+ if (in_array('other', $media_types, true)) {
+ $media_types[] = '';
+ }
+
// We can apply the filters using SQL
// Do not use "ORDER BY RAND()" - it is very slow on large tables. Use PHP::array_rand() instead.
$all_media = DB::table('media')
|
Media type 'other' can include media without a type - #<I>
|
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/projectCommands.js b/bundles/org.eclipse.orion.client.ui/web/orion/projectCommands.js
index <HASH>..<HASH> 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/projectCommands.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/projectCommands.js
@@ -659,6 +659,8 @@ define(['require', 'i18n!orion/navigate/nls/messages', 'orion/webui/littlelib',
data.oldParams = params;
commandService.collectParameters(data);
} else {
+ item.status = {CheckState: true};
+ sharedLaunchConfigurationDispatcher.dispatchEvent({type: "changeState", newValue: item });
errorHandler(error);
}
});
|
[no bug] restart app progress does not stop if an error occured
|
diff --git a/tests/integration/test.changes.js b/tests/integration/test.changes.js
index <HASH>..<HASH> 100644
--- a/tests/integration/test.changes.js
+++ b/tests/integration/test.changes.js
@@ -859,6 +859,11 @@ adapters.forEach(function (adapter) {
// Note for the following test that CouchDB's implementation of /_changes
// with `descending=true` ignores any `since` parameter.
it('Descending changes', function (done) {
+ // _changes in CouchDB 2.0 does not guarantee order
+ // so skip this test
+ if (testUtils.isCouchMaster()) {
+ return done();
+ }
var db = new PouchDB(dbs.name);
db.post({_id: '0', test: 'ing'}, function (err, res) {
db.post({_id: '1', test: 'ing'}, function (err, res) {
|
(#<I>) - Fix "descending changes" / CouchDB <I>
_changes in CouchDB does not guarantee order so skip the test which
asserts this when testing against CouchDB master.
|
diff --git a/plugins/org.eclipse.xtext/src/org/eclipse/xtext/linking/lazy/LazyLinkingResource.java b/plugins/org.eclipse.xtext/src/org/eclipse/xtext/linking/lazy/LazyLinkingResource.java
index <HASH>..<HASH> 100644
--- a/plugins/org.eclipse.xtext/src/org/eclipse/xtext/linking/lazy/LazyLinkingResource.java
+++ b/plugins/org.eclipse.xtext/src/org/eclipse/xtext/linking/lazy/LazyLinkingResource.java
@@ -118,7 +118,9 @@ public class LazyLinkingResource extends XtextResource {
}
protected void resolveLazyCrossReference(InternalEObject source, EStructuralFeature crossRef) {
- if (crossRef.isDerived())
+ if (crossRef.isDerived()
+ || (crossRef instanceof EReference && !((EReference)crossRef).isResolveProxies())
+ || crossRef.isTransient())
return;
if (crossRef.isMany()) {
@SuppressWarnings("unchecked")
|
[core] added guard for lazy crossref proxy resolution. (see #<I>)
|
diff --git a/src/Go/Core/AspectContainer.php b/src/Go/Core/AspectContainer.php
index <HASH>..<HASH> 100644
--- a/src/Go/Core/AspectContainer.php
+++ b/src/Go/Core/AspectContainer.php
@@ -102,9 +102,9 @@ class AspectContainer extends Container
$this->share('aspect.pointcut.lexer', function () {
return new PointcutLexer();
});
- $this->share('aspect.pointcut.parser', function () {
+ $this->share('aspect.pointcut.parser', function ($container) {
return new Parser(
- new PointcutGrammar($this),
+ new PointcutGrammar($container),
// Include production parse table for parser
include __DIR__ . '/../Aop/Pointcut/PointcutParseTable.php'
);
|
Fix BC with PHP<I>, resolves #<I>
|
diff --git a/salt/modules/sysmod.py b/salt/modules/sysmod.py
index <HASH>..<HASH> 100644
--- a/salt/modules/sysmod.py
+++ b/salt/modules/sysmod.py
@@ -572,7 +572,7 @@ def list_state_functions(*args, **kwargs): # pylint: disable=unused-argument
for func in fnmatch.filter(st_.states, module):
names.add(func)
else:
- # "sys" should just match sys, without also matching sysctl
+ # "sys" should just match sys without also matching sysctl
module = module + '.'
for func in st_.states:
if func.startswith(module):
|
standardize comment text about "sys" vs "sysctl" matching
|
diff --git a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
+++ b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
@@ -101,10 +101,12 @@ module ActionDispatch
# polymorphic_url(Comment) # same as comments_url()
#
def polymorphic_url(record_or_hash_or_array, options = {})
+ recipient = self
+
if record_or_hash_or_array.kind_of?(Array)
record_or_hash_or_array = record_or_hash_or_array.compact
if record_or_hash_or_array.first.is_a?(ActionDispatch::Routing::RoutesProxy)
- proxy = record_or_hash_or_array.shift
+ recipient = record_or_hash_or_array.shift
end
record_or_hash_or_array = record_or_hash_or_array[0] if record_or_hash_or_array.size == 1
end
@@ -139,7 +141,7 @@ module ActionDispatch
args.collect! { |a| convert_to_model(a) }
- (proxy || self).send(named_route, *args)
+ recipient.send(named_route, *args)
end
# Returns the path component of a URL for the given record. It uses
|
eliminate conditional when sending the named route method
|
diff --git a/src/main/java/reactor/ipc/netty/resources/DefaultLoopResources.java b/src/main/java/reactor/ipc/netty/resources/DefaultLoopResources.java
index <HASH>..<HASH> 100644
--- a/src/main/java/reactor/ipc/netty/resources/DefaultLoopResources.java
+++ b/src/main/java/reactor/ipc/netty/resources/DefaultLoopResources.java
@@ -190,7 +190,7 @@ final class DefaultLoopResources extends AtomicLong implements LoopResources {
if (null == eventLoopGroup) {
EventLoopGroup newEventLoopGroup = LoopResources.colocate(cacheNioServerLoops());
if (!clientLoops.compareAndSet(null, newEventLoopGroup)) {
- newEventLoopGroup.shutdownGracefully();
+ // Do not shutdown newEventLoopGroup as this will shutdown the server loops
}
eventLoopGroup = cacheNioClientLoops();
}
@@ -246,7 +246,7 @@ final class DefaultLoopResources extends AtomicLong implements LoopResources {
if (null == eventLoopGroup) {
EventLoopGroup newEventLoopGroup = LoopResources.colocate(cacheNativeServerLoops());
if (!cacheNativeClientLoops.compareAndSet(null, newEventLoopGroup)) {
- newEventLoopGroup.shutdownGracefully();
+ // Do not shutdown newEventLoopGroup as this will shutdown the server loops
}
eventLoopGroup = cacheNativeClientLoops();
}
|
When creating client loop resources do not invoke shutdown on the ColocatedEventLoopGroup
When creating client loop resources do not invoke shutdown on the
ColocatedEventLoopGroup because this will invoke shutdown on the
server loop resource.
|
diff --git a/src/14.Expression.polar.js b/src/14.Expression.polar.js
index <HASH>..<HASH> 100644
--- a/src/14.Expression.polar.js
+++ b/src/14.Expression.polar.js
@@ -2,14 +2,15 @@ Expression.prototype.polar = function() {
var ri = this.realimag();
var two = new Expression.Integer(2);
return Expression.List.ComplexPolar([
- ri[0]['^'](two)['+'](ri[1]['^'](two)),
+ Global.sqrt.default(ri[0]['^'](two)['+'](ri[1]['^'](two))),
Global.atan2.default(Expression.Vector([ri[1], ri[0]]))
]);
};
Expression.prototype.abs = function() {
console.warn('SLOW?');
var ri = this.realimag();
- return ri[0]['*'](ri[0])['+'](ri[1]['*'](ri[1]));
+ var two = new Expression.Integer(2);
+ return Global.sqrt.default(ri[0]['^'](two)['+'](ri[1]['^'](two)));
};
Expression.prototype.arg = function() {
console.warn('Slow?');
|
Fix absolute value of cartesian (was previously x*x+y*y, but should be Sqrt[x^2+y^2])
|
diff --git a/src/main/java/org/jboss/netty/channel/socket/nio/NioSocketChannelConfig.java b/src/main/java/org/jboss/netty/channel/socket/nio/NioSocketChannelConfig.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jboss/netty/channel/socket/nio/NioSocketChannelConfig.java
+++ b/src/main/java/org/jboss/netty/channel/socket/nio/NioSocketChannelConfig.java
@@ -144,5 +144,6 @@ public interface NioSocketChannelConfig extends SocketChannelConfig {
* will be called with the new predictor. The default factory is
* <tt>{@link AdaptiveReceiveBufferSizePredictorFactory}(64, 1024, 65536)</tt>.
*/
- void setReceiveBufferSizePredictorFactory(ReceiveBufferSizePredictorFactory predictorFactory);
+ void setReceiveBufferSizePredictorFactory(
+ ReceiveBufferSizePredictorFactory predictorFactory);
}
|
fixing formatting for NioSocketChannelConfig, which I had incorrectly merged earlier.
|
diff --git a/lib/tessel/deployment/rust.js b/lib/tessel/deployment/rust.js
index <HASH>..<HASH> 100644
--- a/lib/tessel/deployment/rust.js
+++ b/lib/tessel/deployment/rust.js
@@ -28,7 +28,7 @@ var exportables = {
var cargoToml = toml.parse(fs.readFileSync(path.join(pushdir, 'Cargo.toml'), 'utf8'));
if (cargoToml.package) {
- basename = path.basename(program);
+ basename = pushdir;
program = cargoToml.package.name;
}
|
Fixes undefined variable when running t2 run Cargo.toml
|
diff --git a/ploy/__init__.py b/ploy/__init__.py
index <HASH>..<HASH> 100644
--- a/ploy/__init__.py
+++ b/ploy/__init__.py
@@ -525,8 +525,10 @@ class Controller(object):
self.configfile = args.configfile
if args.debug:
logging.root.setLevel(logging.DEBUG)
- args.func(sub_argv, args.func.__doc__)
- self.instances.close_connections()
+ try:
+ args.func(sub_argv, args.func.__doc__)
+ finally:
+ self.instances.close_connections()
def ploy(configpath=None, configname=None, progname=None): # pragma: no cover
|
Always close connections even after an exception.
|
diff --git a/packages/core/logger/src/index.js b/packages/core/logger/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/core/logger/src/index.js
+++ b/packages/core/logger/src/index.js
@@ -95,8 +95,11 @@ Logger.prototype.writeToFile = function (_txt) {
if (!this.logFile) {
return;
}
+
+ let origin = "[" + ((new Error().stack).split("at ")[3]).trim() + "]";
+
const formattedDate = [`[${date.format(new Date(), DATE_FORMAT)}]`]; // adds a timestamp to the logs in the logFile
- fs.appendFileSync(this.logFile, "\n" + formattedDate.concat(Array.from(arguments)).join(' '));
+ fs.appendFileSync(this.logFile, "\n" + formattedDate.concat(origin, Array.from(arguments)).join(' '));
};
Logger.prototype.error = function () {
|
feature (@embark/core): show origin of each log in the logfile logs (#<I>)
|
diff --git a/tests/acceptance/manager/PaymentsCest.php b/tests/acceptance/manager/PaymentsCest.php
index <HASH>..<HASH> 100644
--- a/tests/acceptance/manager/PaymentsCest.php
+++ b/tests/acceptance/manager/PaymentsCest.php
@@ -104,7 +104,7 @@ class PaymentsCest
$page->setBillTotalSum(-$chargesSum);
$I->pressButton('Save');
-// $this->billId = $page->seeActionSuccess();
+ $this->billId = $page->seeActionSuccess();
}
/**
@@ -113,7 +113,7 @@ class PaymentsCest
* @param Manager $I
* @throws \Codeception\Exception\ModuleException
*/
- protected function ensureICanUpdateBill(Manager $I): void
+ public function ensureICanUpdateBill(Manager $I): void
{
$indexPage = new IndexPage($I);
$updatePage = new Update($I);
@@ -139,7 +139,7 @@ class PaymentsCest
* @param Manager $I
* @throws \Exception
*/
- protected function ensureBillWasSuccessfullyUpdated (Manager $I): void
+ public function ensureBillWasSuccessfullyUpdated (Manager $I): void
{
$indexPage = new IndexPage($I);
$updatePage = new Update($I);
|
discard last changes (#<I>)
|
diff --git a/lib/instrumentation/index.js b/lib/instrumentation/index.js
index <HASH>..<HASH> 100644
--- a/lib/instrumentation/index.js
+++ b/lib/instrumentation/index.js
@@ -364,7 +364,7 @@ Instrumentation.prototype.addEndedSpan = function (span) {
this._encodeAndSendSpan(span.getBufferedSpan())
}
- if (span.getParentSpan().ended || !span.isCompressionEligible()) {
+ if (!span.isCompressionEligible() || span.getParentSpan().ended) {
const buffered = span.getBufferedSpan()
if (buffered) {
this._encodeAndSendSpan(buffered)
diff --git a/test/agent.test.js b/test/agent.test.js
index <HASH>..<HASH> 100644
--- a/test/agent.test.js
+++ b/test/agent.test.js
@@ -440,6 +440,7 @@ test('#startSpan()', function (t) {
t.notEqual(span._context.traceparent.id, '00f067aa0ba902b7')
t.strictEqual(span._context.traceparent.parentId, '00f067aa0ba902b7')
t.strictEqual(span._context.traceparent.flags, '01')
+ span.end()
agent.destroy()
t.end()
})
|
fix: span compression handling could crash on a span without a set parent span (#<I>)
Creating a span with a manual `{ childOf: 'some-traceparent-string' }` results
in a span without a parent `Span`. An attempt to compress it on .end()
needs to handle that.
|
diff --git a/src/Behat/Behat/Annotation/Annotation.php b/src/Behat/Behat/Annotation/Annotation.php
index <HASH>..<HASH> 100644
--- a/src/Behat/Behat/Annotation/Annotation.php
+++ b/src/Behat/Behat/Annotation/Annotation.php
@@ -166,7 +166,7 @@ abstract class Annotation implements AnnotationInterface
*/
public function __sleep() {
$serializable = array();
- foreach ( $this as $paramName => $paramValue ) {
+ foreach ($this as $paramName => $paramValue) {
if (!is_string($paramValue) && !is_array($paramValue) && is_callable($paramValue)) {
continue;
}
|
Update Annotation.php
Removed extra spaces.
|
diff --git a/_pytest/terminal.py b/_pytest/terminal.py
index <HASH>..<HASH> 100644
--- a/_pytest/terminal.py
+++ b/_pytest/terminal.py
@@ -7,6 +7,7 @@ import pluggy
import py
import sys
import time
+import platform
def pytest_addoption(parser):
@@ -274,7 +275,7 @@ class TerminalReporter:
if not self.showheader:
return
self.write_sep("=", "test session starts", bold=True)
- verinfo = ".".join(map(str, sys.version_info[:3]))
+ verinfo = platform.python_version()
msg = "platform %s -- Python %s" % (sys.platform, verinfo)
if hasattr(sys, 'pypy_version_info'):
verinfo = ".".join(map(str, sys.pypy_version_info[:3]))
|
Use platform.python_version() to show Python version number
This results in something like "<I>b2" for non-final releases
while still being "<I>" for final releases.
|
diff --git a/edtf/__init__.py b/edtf/__init__.py
index <HASH>..<HASH> 100644
--- a/edtf/__init__.py
+++ b/edtf/__init__.py
@@ -1,5 +1,3 @@
-__version__ = "0.9.2"
-
from edtf_date import EDTFDate
from edtf import EDTF
-from edtf_interval import EDTFInterval
\ No newline at end of file
+from edtf_interval import EDTFInterval
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -23,11 +23,10 @@ from os.path import join, dirname
import setuptools
-from edtf import __version__
setuptools.setup(
name='edtf',
- version=__version__,
+ version='0.9.2',
url='https://github.com/ixc/python-edtf',
author='Greg Turner',
author_email='greg@interaction.net.au',
@@ -52,4 +51,4 @@ setuptools.setup(
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
],
-)
\ No newline at end of file
+)
|
Remove version from '__init__.py' to stop importing packages before they are installed.
|
diff --git a/tests/extensions/test_environment.py b/tests/extensions/test_environment.py
index <HASH>..<HASH> 100644
--- a/tests/extensions/test_environment.py
+++ b/tests/extensions/test_environment.py
@@ -11,6 +11,14 @@ def test_environment_with_inline_default():
assert res == {'a': 1, 'file_path': 'my_file.local.cfg'}
+def test_environment_with_nested_inline_default():
+ jstr = '{"a": 1, "file_path": "my_file.{{env::ENVIRONMENT:={{env::DEFAULT}}.cfg}}"}'
+ with modified_environ('ENVIRONMENT', DEFAULT='the_default'):
+ res = DictMentor().bind(Environment()).load_yaml(jstr)
+
+ assert res == {'a': 1, 'file_path': 'my_file.the_default.cfg'}
+
+
def test_environment_with_multiple_patterns():
jstr = '{"a": 1, "file_path": "{{env::A}}-{{env::B}}-{{env::C}}"}'
with modified_environ(A='aval', B='bval', C='cval'):
|
Adds test case with nested environment default
|
diff --git a/src/main/java/eu/project/ttc/engines/cleaner/TermProperty.java b/src/main/java/eu/project/ttc/engines/cleaner/TermProperty.java
index <HASH>..<HASH> 100644
--- a/src/main/java/eu/project/ttc/engines/cleaner/TermProperty.java
+++ b/src/main/java/eu/project/ttc/engines/cleaner/TermProperty.java
@@ -51,7 +51,7 @@ public enum TermProperty {
WR_LOG_Z_SCORE("wrLogZScore", "zscore", true, Double.class),
FREQUENCY("frequency", "f", false, Integer.class),
PILOT("pilot", "pilot", false, String.class),
- LEMMA("lemma", "lemma", false, String.class),
+ LEMMA("lemma", "lm", false, String.class),
GROUPING_KEY("groupingKey", "gkey", false, String.class),
PATTERN("pattern", "p", false, String.class),
SPOTTING_RULE("spottingRule", "rule", false, String.class),
|
Renamed some properties to match documentation
|
diff --git a/lib/messaging/stream_name.rb b/lib/messaging/stream_name.rb
index <HASH>..<HASH> 100644
--- a/lib/messaging/stream_name.rb
+++ b/lib/messaging/stream_name.rb
@@ -2,8 +2,6 @@ module Messaging
module StreamName
extend self
- include EventSource::StreamName
-
def self.included(cls)
cls.extend Macro
end
|
The EventSource::Stream name module is not mixed-in
|
diff --git a/unyt/array.py b/unyt/array.py
index <HASH>..<HASH> 100644
--- a/unyt/array.py
+++ b/unyt/array.py
@@ -1711,8 +1711,6 @@ class unyt_array(np.ndarray):
return type(self)(np.copy(np.asarray(self)), self.units)
def __array_finalize__(self, obj):
- if obj is None and hasattr(self, 'units'):
- return
self.units = getattr(obj, 'units', NULL_UNIT)
def __pos__(self):
|
get rid of unncessary condition in __array_finalize__
|
diff --git a/examples/association_loader.rb b/examples/association_loader.rb
index <HASH>..<HASH> 100644
--- a/examples/association_loader.rb
+++ b/examples/association_loader.rb
@@ -36,7 +36,7 @@ class AssociationLoader < GraphQL::Batch::Loader
end
def preload_association(records)
- ::ActiveRecord::Associations::Preloader.new.preload(records, @association_name)
+ ::ActiveRecord::Associations::Preloader.new(records: records, associations: @association_name).call
end
def read_association(record)
|
Fix AssociationLoader Rails 7 Deprecation Warning
Currently running this example code with rails 7 yields the following warning:
```
DEPRECATION WARNING: `preload` is deprecated and will be removed in Rails <I>. Call `Preloader.new(kwargs).call` instead.
```
Updating the preloader code to use kwargs and call silences the warning.
|
diff --git a/visidata/cmdlog.py b/visidata/cmdlog.py
index <HASH>..<HASH> 100644
--- a/visidata/cmdlog.py
+++ b/visidata/cmdlog.py
@@ -23,10 +23,10 @@ option('cmdlog_histfile', '', 'file to autorecord each cmdlog action to')
vd.activeCommand = None
def open_vd(p):
- return CommandLog(p.name, source=p)
+ return CommandLog(p.name, source=p, precious=True)
def open_vdj(p):
- return CommandLogJsonl(p.name, source=p)
+ return CommandLogJsonl(p.name, source=p, precious=True)
VisiData.save_vd = VisiData.save_tsv
VisiData.save_vdj = VisiData.save_jsonl
|
[sheets_all-] make opened .vd/.vdj precious
CommandLogs generated by Shift+D are not precious, but loaded data
should be. Since open_vd creates a Sheet using CommandLog(), precious needs to
be set to True.
|
diff --git a/test/client/spec-widget.js b/test/client/spec-widget.js
index <HASH>..<HASH> 100644
--- a/test/client/spec-widget.js
+++ b/test/client/spec-widget.js
@@ -143,7 +143,7 @@ describe('widget' , function() {
label: 'Bar'
});
-
+ expect(widget.el.innerHTML.trim()).to.equal('Bar');
expect(widget.el.parentNode).to.equal(parentNode);
expect(widget.el !== oldEl).to.equal(true);
|
Updated test related to re-render
|
diff --git a/src/environment.js b/src/environment.js
index <HASH>..<HASH> 100644
--- a/src/environment.js
+++ b/src/environment.js
@@ -17,15 +17,19 @@ var loops = [];
* @param {number} [height=300] - viewport height
*/
export function init(canvas, width=300, height=300) {
- scene = scene || new THREE.Scene();
- scene.fog = new THREE.Fog(0x000000, 4, 7);
- renderer = renderer || new THREE.WebGLRenderer({
- canvas: canvas || undefined,
- antialias: true
- });
+ if (!scene) {
+ scene = new THREE.Scene();
+ scene.fog = new THREE.Fog(0x000000, 4, 7);
+ }
- setSize(width, height);
+ if (!renderer) {
+ renderer = new THREE.WebGLRenderer({
+ canvas: canvas || undefined,
+ antialias: true
+ });
+ }
+ setSize(width, height);
startRenderLoop();
}
|
environment.js refactoring
|
diff --git a/djangodblog/manager.py b/djangodblog/manager.py
index <HASH>..<HASH> 100644
--- a/djangodblog/manager.py
+++ b/djangodblog/manager.py
@@ -42,8 +42,17 @@ Note: You will need to create the tables by hand if you use this option.
assert(not getattr(settings, 'DBLOG_DATABASE', None) or django.VERSION < (1, 2), 'The `DBLOG_DATABASE` setting requires Django < 1.2')
class DBLogManager(models.Manager):
+ def _get_settings(self):
+ options = getattr(settings, 'DBLOG_DATABASE', None)
+ if options:
+ if 'DATABASE_PORT' not in options:
+ options['DATABASE_PORT'] = ''
+ if 'DATABASE_OPTIONS' not in options:
+ options['DATABASE_OPTIONS'] = {}
+ return options
+
def get_query_set(self):
- db_options = getattr(settings, 'DBLOG_DATABASE', None)
+ db_options = self._get_settings()
if not db_options:
return super(DBLogManager, self).get_query_set()
@@ -73,7 +82,7 @@ class DBLogManager(models.Manager):
return connection
def _insert(self, values, return_id=False, raw_values=False):
- db_options = getattr(settings, 'DBLOG_DATABASE', None)
+ db_options = self._get_settings()
if not db_options:
return super(DBLogManager, self)._insert(values, return_id, raw_values)
|
Handle defaults for PORT/OPTIONS if they're not set
|
diff --git a/codec-http/src/test/java/io/netty/handler/codec/rtsp/RtspDecoderTest.java b/codec-http/src/test/java/io/netty/handler/codec/rtsp/RtspDecoderTest.java
index <HASH>..<HASH> 100644
--- a/codec-http/src/test/java/io/netty/handler/codec/rtsp/RtspDecoderTest.java
+++ b/codec-http/src/test/java/io/netty/handler/codec/rtsp/RtspDecoderTest.java
@@ -65,7 +65,6 @@ public class RtspDecoderTest {
((FullHttpRequest) res1).release();
HttpObject res2 = ch.readInbound();
- System.out.println(res2);
assertNotNull(res2);
assertTrue(res2 instanceof FullHttpResponse);
((FullHttpResponse) res2).release();
|
Remove System.out.println(...) in test (#<I>)
Motivation:
We did had some System.out.println(...) call in a test which seems to be some left-over from debugging.
Modifications:
Remove System.out.println(...)
Result:
Code cleanup
|
diff --git a/lib/fs_utils/file_list.js b/lib/fs_utils/file_list.js
index <HASH>..<HASH> 100644
--- a/lib/fs_utils/file_list.js
+++ b/lib/fs_utils/file_list.js
@@ -40,6 +40,7 @@ class FileList extends EventEmitter {
this.files = new Map();
this.staticFiles = new Map();
this.assets = [];
+ this.reading = new Map();
this.compiling = new Set();
this.copying = new Set();
this.compiled = new Set();
@@ -86,7 +87,7 @@ class FileList extends EventEmitter {
}
get hasPendingFiles() {
- return !!(this.compiling.size || this.copying.size);
+ return !!(this.reading.size || this.compiling.size || this.copying.size);
}
resetTimer() {
@@ -211,8 +212,13 @@ class FileList extends EventEmitter {
}
debug(`Reading ${path}`);
+ // TODO: What if it's in reading already?
+ const readDate = Date.now();
+ this.reading.set(path, readDate);
readFileAndCache(path).then(() => {
- if (this.disposed) return;
+ const cachedDate = this.reading.get(path);
+ if (this.disposed || !cachedDate || cachedDate > readDate) return;
+ this.reading.delete(path);
// .json files from node_modules should always be compiled
if (!isAsset && !ignored && (compiler && compiler.length) || deppack.isNpmJSON(path)) {
const sourceFile = this.find(path) ||
|
FileList: track files which are being read. Closes gh-<I>.
|
diff --git a/src/preferences/PreferencesDialogs.js b/src/preferences/PreferencesDialogs.js
index <HASH>..<HASH> 100644
--- a/src/preferences/PreferencesDialogs.js
+++ b/src/preferences/PreferencesDialogs.js
@@ -55,7 +55,7 @@ define(function (require, exports, module) {
var obj = PathUtils.parseUrl(url);
if (!obj) {
- result = Strings.BASEURL_ERROR_UNKOWN_ERROR;
+ result = Strings.BASEURL_ERROR_UNKNOWN_ERROR;
} else if (obj.href.search(/^(http|https):\/\//i) !== 0) {
result = StringUtils.format(Strings.BASEURL_ERROR_INVALID_PROTOCOL, obj.href.substring(0, obj.href.indexOf("//")));
} else if (obj.search !== "") {
|
UNKOWN -> UNKNOWN
|
diff --git a/Neos.Utility.Files/Classes/Files.php b/Neos.Utility.Files/Classes/Files.php
index <HASH>..<HASH> 100644
--- a/Neos.Utility.Files/Classes/Files.php
+++ b/Neos.Utility.Files/Classes/Files.php
@@ -180,7 +180,7 @@ abstract class Files
public static function removeEmptyDirectoriesOnPath(string $path, string $basePath = null)
{
if ($basePath !== null) {
- $basePath = trim($basePath, '/');
+ $basePath = rtrim($basePath, '/');
if (strpos($path, $basePath) !== 0) {
throw new FilesException(sprintf('Could not remove empty directories on path because the given base path "%s" is not a parent path of "%s".', $basePath, $path), 1323962907);
}
|
BUGFIX: Do not remove leading slashes from base path
|
diff --git a/lib/endpoint.js b/lib/endpoint.js
index <HASH>..<HASH> 100644
--- a/lib/endpoint.js
+++ b/lib/endpoint.js
@@ -1708,10 +1708,12 @@ function setOrExport(which, endpoint, param, value, callback) {
callback = value ;
}
- const __x = (callback) => {
+ const __x = async(callback) => {
+ const p = [];
for (const [key, value] of Object.entries(obj)) {
- endpoint.execute(which, `${key}=${value}`);
+ p.push(endpoint.execute(which, `${key}=${value}`));
}
+ await Promise.all(p);
callback(null);
} ;
|
fix regression bug: setting multiple channel variables was returning early
|
diff --git a/cassandra/connection.py b/cassandra/connection.py
index <HASH>..<HASH> 100644
--- a/cassandra/connection.py
+++ b/cassandra/connection.py
@@ -443,13 +443,10 @@ class Connection(object):
raise ProtocolError(msg)
def set_keyspace(self, keyspace):
- if not keyspace:
+ if not keyspace or keyspace == self.keyspace:
return
with self.lock:
- if keyspace == self.keyspace:
- return
-
query = 'USE "%s"' % (keyspace,)
try:
result = self.wait_for_response(
|
Move current keyspace check out of Connection lock
|
diff --git a/aiodns/__init__.py b/aiodns/__init__.py
index <HASH>..<HASH> 100644
--- a/aiodns/__init__.py
+++ b/aiodns/__init__.py
@@ -1,5 +1,8 @@
-import asyncio
+try:
+ import asyncio
+except ImportError:
+ import trollius as asyncio
import pycares
from . import error
diff --git a/tests.py b/tests.py
index <HASH>..<HASH> 100755
--- a/tests.py
+++ b/tests.py
@@ -1,6 +1,9 @@
#!/usr/bin/env python
-import asyncio
+try:
+ import asyncio
+except ImportError:
+ import trollius as asyncio
import unittest
import aiodns
|
Adapt to new Trollius version
|
diff --git a/spec/rmagick/image_list/mosaic_spec.rb b/spec/rmagick/image_list/mosaic_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/rmagick/image_list/mosaic_spec.rb
+++ b/spec/rmagick/image_list/mosaic_spec.rb
@@ -9,7 +9,6 @@ RSpec.describe Magick::ImageList, "#mosaic" do
it "raises an error when images is not set" do
image_list = described_class.new
- image_list = image_list.copy
image_list.instance_variable_set("@images", nil)
expect { image_list.mosaic }.to raise_error(Magick::ImageMagickError)
|
RSpec: remove unecessary copy (#<I>)
The copy here doesn't appear to serve any purpose.
|
diff --git a/pes.js b/pes.js
index <HASH>..<HASH> 100644
--- a/pes.js
+++ b/pes.js
@@ -96,7 +96,7 @@ var PES = {
return this.baseRead();
} catch (e) {
this.binary.seek(pos);
- this.binary._bitShift = 0;
+ this.binary.view.alignBy();
}
}
}), {
|
Alignment done via exposed jDataView method.
|
diff --git a/lib/Condorcet/Condorcet.php b/lib/Condorcet/Condorcet.php
index <HASH>..<HASH> 100644
--- a/lib/Condorcet/Condorcet.php
+++ b/lib/Condorcet/Condorcet.php
@@ -736,14 +736,14 @@ class Condorcet
}
}
+ $vote_r['tag'][0] = $this->_nextVoteTag++ ;
+
// Vote identifiant
if ($tag !== null)
{
- $vote_r['tag'] = $this->tagsConvert($tag) ;
+ $vote_r['tag'] = array_merge($vote_r['tag'], $this->tagsConvert($tag)) ;
}
- $vote_r['tag'][] = $this->_nextVoteTag++ ;
-
// Register
$this->_Votes[] = $vote_r ;
|
Vote ID by tag will ever be first tag entry
|
diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php
index <HASH>..<HASH> 100644
--- a/cake/console/libs/tasks/view.php
+++ b/cake/console/libs/tasks/view.php
@@ -159,6 +159,7 @@ class ViewTask extends Shell {
**/
function all() {
$actions = $this->scaffoldActions;
+ $this->Controller->interactive = false;
$tables = $this->Controller->listAll($this->connection, false);
$this->interactive = false;
foreach ($tables as $table) {
@@ -167,9 +168,7 @@ class ViewTask extends Shell {
$this->controllerPath = Inflector::underscore($this->controllerName);
if (App::import('Model', $model)) {
$vars = $this->__loadController();
- if ($vars) {
- $this->bakeActions($actions, $vars);
- }
+ $this->bakeActions($actions, $vars);
}
}
}
|
Removing more if() blocks
Silencing Controller task in all()
|
diff --git a/src/AbstractArrayBackedDaftObject.php b/src/AbstractArrayBackedDaftObject.php
index <HASH>..<HASH> 100644
--- a/src/AbstractArrayBackedDaftObject.php
+++ b/src/AbstractArrayBackedDaftObject.php
@@ -294,12 +294,8 @@ abstract class AbstractArrayBackedDaftObject extends AbstractDaftObject implemen
*/
$propVal = $array[$prop];
- if (isset($jsonDef[$prop])) {
- $jsonType = $jsonDef[$prop];
-
- if (false === is_array($propVal)) {
- static::ThrowBecauseArrayJsonTypeNotValid($jsonType, $prop);
- }
+ if (isset($jsonDef[$prop]) && false === is_array($propVal)) {
+ static::ThrowBecauseArrayJsonTypeNotValid($jsonDef[$prop], $prop);
}
return $propVal;
|
merging if conditions & removing redundant variable assignments
|
diff --git a/escpos/printer.py b/escpos/printer.py
index <HASH>..<HASH> 100644
--- a/escpos/printer.py
+++ b/escpos/printer.py
@@ -167,7 +167,7 @@ class Network(Escpos):
:param msg: arbitrary code to be printed
"""
- self.device.send(msg)
+ self.device.sendall(msg)
def __del__(self):
""" Close TCP connection """
|
IMPROVE use sendall instead of send in network-printer
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -375,7 +375,7 @@ function pages(options, callback) {
// The new syntax for aposArea() requires a more convincing fake page!
// Populate slug and permissions correctly
req.extras[item] = page ? page : { slug: item };
- if (!page) {
+ if (!page && req.user && req.user.permissions.admin) {
req.extras[item]._edit = true;
}
return callback(null);
|
fixed a bug where the edit controls for `global` areas and singletons appeared before an admin logged in (if global did not yet exist). You could not actually edit it (not a security flaw).
|
diff --git a/ontquery/__init__.py b/ontquery/__init__.py
index <HASH>..<HASH> 100644
--- a/ontquery/__init__.py
+++ b/ontquery/__init__.py
@@ -964,6 +964,7 @@ class InterLexRemote(OntService): # note to self
def __init__(self, *args, host='uri.interlex.org', port='', **kwargs):
self.host = host
self.port = port
+ self._not_ok_cache = set()
import rdflib # FIXME
self.Graph = rdflib.Graph
@@ -1025,8 +1026,12 @@ class InterLexRemote(OntService): # note to self
else:
return None
+ if url in self._not_ok_cache:
+ return None
+
resp = get(url)
if not resp.ok:
+ self._not_ok_cache.add(url)
return None
ttl = resp.content
g = self.Graph().parse(data=ttl, format='turtle')
|
interlex remote added not ok cache
|
diff --git a/tests/calculators/hazard/classical/post_processing_test.py b/tests/calculators/hazard/classical/post_processing_test.py
index <HASH>..<HASH> 100644
--- a/tests/calculators/hazard/classical/post_processing_test.py
+++ b/tests/calculators/hazard/classical/post_processing_test.py
@@ -410,7 +410,6 @@ def _curve_db(location_nr, level_nr, curves_per_location, sigma):
class HazardMapsTestCase(unittest.TestCase):
- pass
def test_compute_hazard_map(self):
aaae = numpy.testing.assert_array_almost_equal
|
tests/calcs/hazard/classical/post_processing_test:
Removed a superfluous `pass` from a test case class.
|
diff --git a/src/FrameReflower/Text.php b/src/FrameReflower/Text.php
index <HASH>..<HASH> 100644
--- a/src/FrameReflower/Text.php
+++ b/src/FrameReflower/Text.php
@@ -109,7 +109,9 @@ class Text extends AbstractFrameReflower
}
// split the text into words
- $words = preg_split('/([\s-]+)/u', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
+ // regex splits on everything that's a separator (^\S double negative), excluding nbsp (\xa0), plus dashes
+ //TODO: this misses narrow nbsp (http://www.fileformat.info/info/unicode/char/202f/index.htm)
+ $words = preg_split('/([^\S\xA0]+|-+)/u', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
$wc = count($words);
// Determine the split point
|
Exclude nbsp from word boundary detection
When we added the Unicode flag to the text splitting regex it appears that the \s escape sequence was modified to include the full set of Unicode space separators. This set includes the no-break space (nbsp) character. With this update we're now using a double negative to select the same set of characters, minus the nbsp character.
Addresses #<I>
|
diff --git a/CrashReport/src/org/acra/ErrorReporter.java b/CrashReport/src/org/acra/ErrorReporter.java
index <HASH>..<HASH> 100644
--- a/CrashReport/src/org/acra/ErrorReporter.java
+++ b/CrashReport/src/org/acra/ErrorReporter.java
@@ -339,6 +339,7 @@ public class ErrorReporter implements Thread.UncaughtExceptionHandler {
*/
private void saveCrashReportFile() {
try {
+ Log.d(LOG_TAG, "Writing crash report file.");
Random generator = new Random();
int random = generator.nextInt(99999);
String FileName = "stack-" + random + ".stacktrace";
@@ -405,11 +406,13 @@ public class ErrorReporter implements Thread.UncaughtExceptionHandler {
input.close();
}
+
+ sendCrashReport(context, previousCrashReport);
+
// DELETE FILES !!!!
File curFile = new File(mCrashProperties.get(FILE_PATH_KEY)
+ "/" + curString);
curFile.delete();
- sendCrashReport(context, previousCrashReport);
}
}
} catch (Exception e) {
|
Delete report file only after succesful sending...
|
diff --git a/src/Product/PriceSnippetRenderer.php b/src/Product/PriceSnippetRenderer.php
index <HASH>..<HASH> 100644
--- a/src/Product/PriceSnippetRenderer.php
+++ b/src/Product/PriceSnippetRenderer.php
@@ -60,14 +60,14 @@ class PriceSnippetRenderer implements SnippetRenderer
*/
public function render(Product $product)
{
- return $this->renderProductPriceInContexts($product);
+ return $this->renderProductPrice($product);
}
/**
* @param Product $product
* @return SnippetList
*/
- private function renderProductPriceInContexts(Product $product)
+ private function renderProductPrice(Product $product)
{
return new SnippetList(...$this->getPriceSnippets($product));
}
@@ -104,6 +104,7 @@ class PriceSnippetRenderer implements SnippetRenderer
$key = $this->getSnippetKeyForCountry($product, $country);
$amount = $product->getFirstValueOfAttribute($this->priceAttributeCode);
$price = new Price($amount);
+ // todo: apply tax here
return Snippet::create($key, $price->getAmount());
}
|
Issue #<I>: Refactor method name to be more descriptive in the overall flow
|
diff --git a/packages/openneuro-client/src/datasets.js b/packages/openneuro-client/src/datasets.js
index <HASH>..<HASH> 100644
--- a/packages/openneuro-client/src/datasets.js
+++ b/packages/openneuro-client/src/datasets.js
@@ -15,6 +15,7 @@ export const getDataset = gql`
email
}
draft {
+ id
modified
files {
id
|
fix bug in apollo draft query
|
diff --git a/jodd-mail/src/main/java/jodd/mail/SendMailSession.java b/jodd-mail/src/main/java/jodd/mail/SendMailSession.java
index <HASH>..<HASH> 100644
--- a/jodd-mail/src/main/java/jodd/mail/SendMailSession.java
+++ b/jodd-mail/src/main/java/jodd/mail/SendMailSession.java
@@ -80,6 +80,13 @@ public class SendMailSession {
}
/**
+ * Returns {@code true} if mail session is still connected.
+ */
+ public boolean isConnected() {
+ return mailTransport.isConnected();
+ }
+
+ /**
* Prepares message and sends it.
* Returns Message ID of sent email.
*/
|
Added isConnected() method (closes #<I>)
|
diff --git a/handlers/session_channel_handler_windows2016.go b/handlers/session_channel_handler_windows2016.go
index <HASH>..<HASH> 100644
--- a/handlers/session_channel_handler_windows2016.go
+++ b/handlers/session_channel_handler_windows2016.go
@@ -329,7 +329,7 @@ func (sess *session) handleSubsystemRequest(request *ssh.Request) {
}
lagerWriter := helpers.NewLagerWriter(logger.Session("sftp-server"))
- sftpServer, err := sftp.NewServer(sess.channel, sess.channel, sftp.WithDebug(lagerWriter))
+ sftpServer, err := sftp.NewServer(sess.channel, sftp.WithDebug(lagerWriter))
if err != nil {
logger.Error("sftp-new-server-failed", err)
if request.WantReply {
|
bump to latest sftp server for windows channel handler
|
diff --git a/MultipleFileUpload/MultipleFileUpload.php b/MultipleFileUpload/MultipleFileUpload.php
index <HASH>..<HASH> 100644
--- a/MultipleFileUpload/MultipleFileUpload.php
+++ b/MultipleFileUpload/MultipleFileUpload.php
@@ -241,10 +241,6 @@ class MultipleFileUpload extends Forms\Controls\UploadControl {
* @param string $label Label
*/
public function __construct($label = NULL, $maxSelectedFiles = 25) {
- // Monitorování
- $this->monitor('Nette\Forms\Form');
- //$this->monitor('Nette\Application\Presenter');
-
parent::__construct($label);
if (!self::$handleUploadsCalled) {
@@ -257,16 +253,6 @@ class MultipleFileUpload extends Forms\Controls\UploadControl {
$this->simUploadThreads = 5;
}
- /**
- * Monitoring
- * @param mixed $component
- */
- protected function attached($component) {
- if ($component instanceof Nette\Application\UI\Form) {
- $component->getElementPrototype()->enctype = 'multipart/form-data';
- $component->getElementPrototype()->method = 'post';
- }
- }
/**
* Generates control
|
remove redundant monitoring (already in UploadControl)
|
diff --git a/spec/bitbucket_rest_api/repos/pull_request_spec.rb b/spec/bitbucket_rest_api/repos/pull_request_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/bitbucket_rest_api/repos/pull_request_spec.rb
+++ b/spec/bitbucket_rest_api/repos/pull_request_spec.rb
@@ -85,20 +85,20 @@ describe BitBucket::Repos::PullRequest do
},
close_source_branch: true
}
+ end
+ it 'makes a POST request to create a new pull request' do
expect(subject).to receive(:request).with(
:post,
'/2.0/repositories/mock_user/mock_repo/pullrequests',
@params
)
- end
- it 'makes a POST request to create a new pull request' do
subject.create('mock_user', 'mock_repo', @params)
end
- xit 'validates presence of required params' do
- # expect do
+ it 'validates presence of required params' do
+ expect do
subject.create(
'mock_user',
'mock_repo',
@@ -124,7 +124,7 @@ describe BitBucket::Repos::PullRequest do
close_source_branch: true
}
)
- # end.to(raise_error())
+ end.to raise_error
end
end
|
Fix skipped test in pull_request_spec
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -27,7 +27,7 @@ def extras_require():
def main():
setup(
name='straitlets',
- version='0.2.4',
+ version='0.2.5',
description="Serializable IPython Traitlets",
author="Quantopian Team",
author_email="opensource@quantopian.com",
|
BLD: Bump PyPI version
|
diff --git a/slick.grid.js b/slick.grid.js
index <HASH>..<HASH> 100644
--- a/slick.grid.js
+++ b/slick.grid.js
@@ -1507,6 +1507,10 @@ if (typeof Slick === "undefined") {
ensureCellNodesInRowsCache(row);
for (var columnIdx in cacheEntry.cellNodesByColumnIdx) {
+ if (!cacheEntry.cellNodesByColumnIdx.hasOwnProperty(columnIdx)) {
+ continue;
+ }
+
columnIdx = columnIdx | 0;
var m = columns[columnIdx],
d = getDataItem(row),
|
Fix #<I> - check hasOwnProperty() in for (... in ...) loops over arrays.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.