diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/lib/byebug/commands/set.rb b/lib/byebug/commands/set.rb
index <HASH>..<HASH> 100644
--- a/lib/byebug/commands/set.rb
+++ b/lib/byebug/commands/set.rb
@@ -54,7 +54,7 @@ module Byebug
if setting_value == true
Byebug.post_mortem
else
- return print 'Sorry... not implemented yet. Restart byebug'
+ Byebug.post_mortem = false
end
when /^autoeval|autoreload|basename|forcestep|fullpath|linetrace_plus|
testing|stack_on_error$/x | Allow disabling post_mortem mode |
diff --git a/bika/lims/upgrade/to1115.py b/bika/lims/upgrade/to1115.py
index <HASH>..<HASH> 100644
--- a/bika/lims/upgrade/to1115.py
+++ b/bika/lims/upgrade/to1115.py
@@ -16,5 +16,4 @@ def upgrade(tool):
bc.delIndex('getSamplePointTitle')
bc.addIndex('getSampleTypeTitle', 'KeywordIndex')
bc.addIndex('getSamplePointTitle', 'KeywordIndex')
- for o in bc():
- o.reindexObject(idxs=['getSampleTypeTitle', 'getSamplePointTitle'])
+ bc.clearFindAndRebuild() | Fix upgrade step <I>: rebuild catalog |
diff --git a/src/Bridge/NetteDI/OrmExtension.php b/src/Bridge/NetteDI/OrmExtension.php
index <HASH>..<HASH> 100644
--- a/src/Bridge/NetteDI/OrmExtension.php
+++ b/src/Bridge/NetteDI/OrmExtension.php
@@ -29,12 +29,7 @@ class OrmExtension extends CompilerExtension
if (!isset($config['model'])) {
throw new InvalidStateException('Model is not defined.');
}
- }
-
- public function beforeCompile()
- {
- $config = $this->getConfig();
$repositories = $this->getRepositoryList($config['model']);
$repositoriesConfig = Model::getConfiguration($repositories);
diff --git a/src/Bridge/NetteDI/OrmTestsExtension.php b/src/Bridge/NetteDI/OrmTestsExtension.php
index <HASH>..<HASH> 100644
--- a/src/Bridge/NetteDI/OrmTestsExtension.php
+++ b/src/Bridge/NetteDI/OrmTestsExtension.php
@@ -21,15 +21,9 @@ class OrmTestsExtension extends OrmExtension
public function loadConfiguration()
{
- parent::loadConfiguration();
$config = $this->getConfig(['testingMappers' => TRUE]);
$this->testingMappers = $config['testingMappers'];
- }
-
-
- public function beforeCompile()
- {
- parent::beforeCompile();
+ parent::loadConfiguration();
$this->setupEntityCreator();
} | nette di: fixed late service definition in compiler extension |
diff --git a/src/Console/SchemaUpdateCommand.php b/src/Console/SchemaUpdateCommand.php
index <HASH>..<HASH> 100644
--- a/src/Console/SchemaUpdateCommand.php
+++ b/src/Console/SchemaUpdateCommand.php
@@ -84,8 +84,10 @@ class SchemaUpdateCommand extends Command
$this->getName()));
$this->comment(sprintf(' <info>php artisan %s --sql</info> to dump the SQL statements to the screen',
$this->getName()));
+
+ return 1;
}
- return 1;
+ return 0;
}
} | [FIX] Fix exit codes for SchemaUpdateCommand (#<I>)
* Fix exit codes for SchemaUpdateCommand
* Fix StyleCI issue |
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/QuatSymmetryResults.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/QuatSymmetryResults.java
index <HASH>..<HASH> 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/QuatSymmetryResults.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/QuatSymmetryResults.java
@@ -98,6 +98,11 @@ public class QuatSymmetryResults {
this.clusters = clusters;
this.stoichiometry = SubunitClusterUtils
.getStoichiometryString(clusters);
+
+ subunits = new ArrayList<Subunit>();
+ for (SubunitCluster c : clusters) {
+ subunits.addAll(c.getSubunits());
+ }
this.helixLayers = helixLayers;
this.method = method;
@@ -117,11 +122,8 @@ public class QuatSymmetryResults {
*
* @return an unmodifiable view of the List
*/
- public List<Subunit> getSubunits() {
- if (subunits != null)
- return Collections.unmodifiableList(subunits);
- else
- return Collections.unmodifiableList(new ArrayList<>());
+ public List<Subunit> getSubunits() {
+ return Collections.unmodifiableList(subunits);
}
/** | Better fix for null subunits as advised by @lafita |
diff --git a/htdocs/api/v1/alert-dbapi.py b/htdocs/api/v1/alert-dbapi.py
index <HASH>..<HASH> 100755
--- a/htdocs/api/v1/alert-dbapi.py
+++ b/htdocs/api/v1/alert-dbapi.py
@@ -21,7 +21,7 @@ import logging
import pytz
import re
-__version__ = '1.9.5'
+__version__ = '1.9.6'
BROKER_LIST = [('localhost', 61613)] # list of brokers for failover
NOTIFY_TOPIC = '/topic/notify'
@@ -266,7 +266,7 @@ def main():
{ '$inc': { "count": 1, "totalTime": diff}},
True)
- m = re.search(r'[PUT|POST] /alerta/api/v1/alerts/alert/(?P<id>[a-z0-9-]+)$', request)
+ m = re.search(r'(PUT|POST) /alerta/api/v1/alerts/alert/(?P<id>[a-z0-9-]+)$', request)
if m:
alertid = m.group('id')
query['_id'] = dict() | Wrong brackets in regex |
diff --git a/app/scripts/Insets2dTrack.js b/app/scripts/Insets2dTrack.js
index <HASH>..<HASH> 100644
--- a/app/scripts/Insets2dTrack.js
+++ b/app/scripts/Insets2dTrack.js
@@ -555,6 +555,13 @@ export default class Insets2dTrack extends PixiTrack {
return base64ToCanvas(data);
}
+ remove() {
+ // Make sure we remove all insets to avoid memory leaks
+ this.insets.forEach((inset) => {
+ this.destroyInset(inset.id);
+ });
+ }
+
setDimensions(newDimensions) {
super.setDimensions(newDimensions); | Destroy insets on track removal to avoid memory leaks |
diff --git a/dalesbred/src/main/java/fi/evident/dalesbred/Database.java b/dalesbred/src/main/java/fi/evident/dalesbred/Database.java
index <HASH>..<HASH> 100644
--- a/dalesbred/src/main/java/fi/evident/dalesbred/Database.java
+++ b/dalesbred/src/main/java/fi/evident/dalesbred/Database.java
@@ -172,6 +172,13 @@ public final class Database {
}
}
+ /**
+ * Returns true if and only if the current thread has an active transaction for this database.
+ */
+ public boolean hasActiveTransaction() {
+ return activeTransaction.get() != null;
+ }
+
private <T> T withSuspendedTransaction(@Nullable Isolation isolation, @NotNull TransactionCallback<T> callback) {
DatabaseTransaction suspended = activeTransaction.get();
try { | Added method for checking if there's an active transaction. |
diff --git a/keyring/backend.py b/keyring/backend.py
index <HASH>..<HASH> 100644
--- a/keyring/backend.py
+++ b/keyring/backend.py
@@ -28,11 +28,6 @@ except ImportError:
def abstractproperty(funcobj):
return property(funcobj)
-try:
- import gnomekeyring
-except ImportError:
- pass
-
_KEYRING_SETTING = 'keyring-setting'
_CRYPTED_PASSWORD = 'crypted-password'
_BLOCK_SIZE = 32 | Remove the try import that has not point. |
diff --git a/insteonplm/plm.py b/insteonplm/plm.py
index <HASH>..<HASH> 100644
--- a/insteonplm/plm.py
+++ b/insteonplm/plm.py
@@ -273,13 +273,14 @@ class PLM(asyncio.Protocol):
# we can use that as the device type for this record
# Otherwise we need to request the device ID.
if device is not None:
- if device.prod_data_in_aldb:
- if device is not None:
- if isinstance(device, list):
- for currdev in device:
+ if device is not None:
+ if isinstance(device, list):
+ for currdev in device:
+ if device.prod_data_in_aldb:
self.devices[currdev.id] = currdev
self.log.info('Device with id %s added to device list from ALDB Data.', currdev.id)
- else:
+ else:
+ if device.prod_data_in_aldb:
self.devices[device.id] = device
self.log.info('Device with id %s added to device list from ALDB data.', device.id) | Fixed adding complex devices from ALDB data |
diff --git a/Helper/Order.php b/Helper/Order.php
index <HASH>..<HASH> 100644
--- a/Helper/Order.php
+++ b/Helper/Order.php
@@ -979,10 +979,6 @@ class Order extends AbstractHelper
$this->setShippingMethod($quote, $transaction);
$this->quoteAfterChange($quote);
- $email = @$transaction->order->cart->billing_address->email_address ?:
- @$transaction->order->cart->shipments[0]->shipping_address->email_address;
- $this->addCustomerDetails($quote, $email);
-
// Check if Mageplaza Gift Card data exist and apply it to the parent quote
$this->discountHelper->applyMageplazaDiscountToQuote($quote);
@@ -998,6 +994,10 @@ class Order extends AbstractHelper
]
);
+ $email = @$transaction->order->cart->billing_address->email_address ?:
+ @$transaction->order->cart->shipments[0]->shipping_address->email_address;
+ $this->addCustomerDetails($quote, $email);
+
$quote->setReservedOrderId($quote->getBoltReservedOrderId());
$this->cartHelper->quoteResourceSave($quote); | Ensure customer email is set to the quote before saving the order (#<I>) |
diff --git a/media/boom/js/boom/wysihtml5.js b/media/boom/js/boom/wysihtml5.js
index <HASH>..<HASH> 100644
--- a/media/boom/js/boom/wysihtml5.js
+++ b/media/boom/js/boom/wysihtml5.js
@@ -187,10 +187,13 @@ $.widget('wysihtml5.editor', $.boom.textEditor,
_insert_toolbar : function(element) {
var self = this;
- return $.get('/cms/toolbar/text?mode=' + self.mode)
- .done(function(response) {
- top.$('body').prepend(response)
- });
+ return $.ajax({
+ url : '/cms/toolbar/text?mode=' + self.mode,
+ cache : true,
+ })
+ .done(function(response) {
+ top.$('body').prepend(response)
+ });
},
/** | Don't cache text editor toolbars |
diff --git a/lib/http-client.js b/lib/http-client.js
index <HASH>..<HASH> 100644
--- a/lib/http-client.js
+++ b/lib/http-client.js
@@ -60,7 +60,7 @@ function onCommand(question, cb) {
}
).on("error", function(err) {
body = err;
- onCallback(err, body, res, cb);
+ onCallback(err, body, null, cb);
}).end();
}
diff --git a/lib/run.js b/lib/run.js
index <HASH>..<HASH> 100644
--- a/lib/run.js
+++ b/lib/run.js
@@ -58,6 +58,13 @@ function run(question, cb) {
}
).on("error", function(err) {
body = err;
+
+ if (options.json === true) {
+ cservice.results(JSON.stringify(body));
+ } else {
+ cservice.results(util.inspect(body, { depth: null, colors: true }));
+ }
+
cb && cb(err, body);
}).end();
}
diff --git a/package.json b/package.json
index <HASH>..<HASH> 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "cluster-service",
- "version": "0.5.8",
+ "version": "0.5.9",
"author": {
"name": "Aaron Silvas",
"email": "asilvas@godaddy.com" | fix error handling for client & run |
diff --git a/Adapter/PlentymarketsAdapter/ResponseParser/OrderStatus/OrderStatusResponseParser.php b/Adapter/PlentymarketsAdapter/ResponseParser/OrderStatus/OrderStatusResponseParser.php
index <HASH>..<HASH> 100644
--- a/Adapter/PlentymarketsAdapter/ResponseParser/OrderStatus/OrderStatusResponseParser.php
+++ b/Adapter/PlentymarketsAdapter/ResponseParser/OrderStatus/OrderStatusResponseParser.php
@@ -31,6 +31,10 @@ class OrderStatusResponseParser implements OrderStatusResponseParserInterface
*/
public function parse(array $entry)
{
+ if (empty($entry['id'])) {
+ return null;
+ }
+
$identity = $this->identityService->findOneOrCreate(
(string) $entry['id'],
PlentymarketsAdapter::NAME, | extra safety check for order statuses from plentymarkets |
diff --git a/theanets/layers.py b/theanets/layers.py
index <HASH>..<HASH> 100644
--- a/theanets/layers.py
+++ b/theanets/layers.py
@@ -1006,7 +1006,7 @@ class MRNN(Recurrent):
x = inputs['out']
h = TT.dot(x, self.find('xh')) + self.find('b')
f = TT.dot(x, self.find('xf'))
- (pre, factors, out), updates = self._scan(fn, [h, f], [None, x])
+ (pre, out), updates = self._scan(fn, [h, f], [None, x])
return dict(pre=pre, factors=f, out=out), updates | We don't return factors from scan! |
diff --git a/config/webpack.js b/config/webpack.js
index <HASH>..<HASH> 100644
--- a/config/webpack.js
+++ b/config/webpack.js
@@ -116,7 +116,8 @@ const shared = {
},
timeout: 80000,
plugins: [
- new webpack.DefinePlugin({'fs.writeSync': false})
+ new webpack.DefinePlugin({'fs.writeSync': false}),
+ new webpack.optimize.DedupePlugin()
]
} | feat(webpack): enable dedupe plugin |
diff --git a/lib/http/request/writer.rb b/lib/http/request/writer.rb
index <HASH>..<HASH> 100644
--- a/lib/http/request/writer.rb
+++ b/lib/http/request/writer.rb
@@ -68,7 +68,7 @@ module HTTP
elsif @body.is_a?(Enumerable)
@body.each do |chunk|
@socket << chunk.bytesize.to_s(16) << CRLF
- @socket << chunk
+ @socket << chunk << CRLF
end
@socket << '0' << CRLF * 2
diff --git a/spec/http/request/writer_spec.rb b/spec/http/request/writer_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/http/request/writer_spec.rb
+++ b/spec/http/request/writer_spec.rb
@@ -21,5 +21,13 @@ describe HTTP::Request::Writer do
it "does throw on a body that isn't string, enumerable or nil" do
expect { construct true }.to raise_error
end
+
+ it 'writes a chunked request from an Enumerable correctly' do
+ io = StringIO.new
+ writer = HTTP::Request::Writer.new(io, %w[bees cows], [], '')
+ writer.send_request_body
+ io.rewind
+ expect(io.string).to eq "4\r\nbees\r\n4\r\ncows\r\n0\r\n\r\n"
+ end
end
end | Added missing CRLF for chunked bodies |
diff --git a/cmd/kubeadm/app/cmd/phases/init/waitcontrolplane.go b/cmd/kubeadm/app/cmd/phases/init/waitcontrolplane.go
index <HASH>..<HASH> 100644
--- a/cmd/kubeadm/app/cmd/phases/init/waitcontrolplane.go
+++ b/cmd/kubeadm/app/cmd/phases/init/waitcontrolplane.go
@@ -19,6 +19,7 @@ package phases
import (
"fmt"
"io"
+ "os"
"path/filepath"
"text/template"
"time"
@@ -100,6 +101,13 @@ func runWaitControlPlanePhase(c workflow.RunData) error {
return errors.New("couldn't initialize a Kubernetes cluster")
}
+ // Deletes the kubelet boostrap kubeconfig file, so the credential used for TLS bootstrap is removed from disk
+ // This is done only on success.
+ bootstrapKubeConfigFile := kubeadmconstants.GetBootstrapKubeletKubeConfigPath()
+ if err := os.Remove(bootstrapKubeConfigFile); err != nil {
+ klog.Warningf("[wait-control-plane] could not delete the file %q: %v", bootstrapKubeConfigFile, err)
+ }
+
return nil
} | kubeadm: delete boostrap-kubelet.conf after TLS bootstrap on init |
diff --git a/src/CoandaCMS/Coanda/Pages/PagesModuleProvider.php b/src/CoandaCMS/Coanda/Pages/PagesModuleProvider.php
index <HASH>..<HASH> 100644
--- a/src/CoandaCMS/Coanda/Pages/PagesModuleProvider.php
+++ b/src/CoandaCMS/Coanda/Pages/PagesModuleProvider.php
@@ -445,6 +445,18 @@ class PagesModuleProvider implements \CoandaCMS\Coanda\CoandaModuleProvider {
throw new \Exception('Home page not created yet!');
}
+ private function renderAttributes($page, $pagelocation)
+ {
+ $attributes = new \stdClass;
+
+ foreach ($page->attributes as $attribute)
+ {
+ $attributes->{$attribute->identifier} = $attribute->render($page, $pagelocation);
+ }
+
+ return $attributes;
+ }
+
/**
* @param $page
* @param bool $pagelocation
@@ -468,7 +480,7 @@ class PagesModuleProvider implements \CoandaCMS\Coanda\CoandaModuleProvider {
'page' => $page,
'location' => $pagelocation,
'meta' => $meta,
- 'attributes' => $pagelocation->attributes
+ 'attributes' => $this->renderAttributes($page, $pagelocation)
];
// Make the view and pass all the render data to it... | Reinstated the renderAttributes method in the pages module. This is in case there is no location, in the case of the home page. |
diff --git a/pavement.py b/pavement.py
index <HASH>..<HASH> 100644
--- a/pavement.py
+++ b/pavement.py
@@ -70,6 +70,13 @@ def test_install():
sh('%s setup.py install' % VPYEXEC)
@task
+def build_version_files(options):
+ from common import write_version
+ write_version(os.path.join("scikits", "audiolab", "version.py"))
+ if os.path.exists(os.path.join("docs", "src")):
+ write_version(os.path.join("docs", "src", "audiolab_version.py"))
+
+@task
#@needs(['latex', 'html'])
def dmg():
builddir = path("build") / "dmg"
@@ -118,6 +125,7 @@ if paver.doctools.has_sphinx:
return Bunch(locals())
@task
+ @needs('build_version_files')
def latex():
"""Build Audiolab's documentation and install it into
scikits/audiolab/docs"""
@@ -134,7 +142,7 @@ if paver.doctools.has_sphinx:
pdf.move(destdir)
@task
- @needs(['paver.doctools.html'])
+ @needs('build_version_files', 'paver.doctools.html')
def html_build():
"""Build Audiolab's html documentation."""
pass | Automatically build version file for doc. |
diff --git a/moto/logs/models.py b/moto/logs/models.py
index <HASH>..<HASH> 100644
--- a/moto/logs/models.py
+++ b/moto/logs/models.py
@@ -19,7 +19,7 @@ class LogEvent:
def to_filter_dict(self):
return {
- "eventId": self.eventId,
+ "eventId": str(self.eventId),
"ingestionTime": self.ingestionTime,
# "logStreamName":
"message": self.message,
diff --git a/tests/test_logs/test_logs.py b/tests/test_logs/test_logs.py
index <HASH>..<HASH> 100644
--- a/tests/test_logs/test_logs.py
+++ b/tests/test_logs/test_logs.py
@@ -121,4 +121,8 @@ def test_filter_logs_interleaved():
interleaved=True,
)
events = res['events']
- events.should.have.length_of(2)
+ for original_message, resulting_event in zip(messages, events):
+ resulting_event['eventId'].should.equal(str(resulting_event['eventId']))
+ resulting_event['timestamp'].should.equal(original_message['timestamp'])
+ resulting_event['message'].should.equal(original_message['message'])
+ | Filter event log ids should be strings
Based on the boto docs, eventId should be returned as a string.
<URL> |
diff --git a/library/Controller/BaseController.php b/library/Controller/BaseController.php
index <HASH>..<HASH> 100644
--- a/library/Controller/BaseController.php
+++ b/library/Controller/BaseController.php
@@ -12,7 +12,6 @@ class BaseController
public function __construct()
{
- add_filter('HbgBlade/data', array($this, 'getData'));
$this->init();
}
@@ -27,6 +26,6 @@ class BaseController
*/
public function getData()
{
- return $this->data;
+ return apply_filters('HbgBlade/data', $this->data);
}
} | Correted code error for blade data filter |
diff --git a/mutagen/id3.py b/mutagen/id3.py
index <HASH>..<HASH> 100644
--- a/mutagen/id3.py
+++ b/mutagen/id3.py
@@ -623,13 +623,16 @@ class ID3(DictProxy, mutagen.Metadata):
# TDAT, TYER, and TIME have been turned into TDRC.
try:
- if str(self.get("TYER", "")).strip("\x00"):
- date = str(self.pop("TYER"))
- if str(self.get("TDAT", "")).strip("\x00"):
- dat = str(self.pop("TDAT"))
+ date = text_type(self.get("TYER", ""))
+ if date.strip(u"\x00"):
+ self.pop("TYER")
+ dat = text_type(self.get("TDAT", ""))
+ if dat.strip("\x00"):
+ self.pop("TDAT")
date = "%s-%s-%s" % (date, dat[2:], dat[:2])
- if str(self.get("TIME", "")).strip("\x00"):
- time = str(self.pop("TIME"))
+ time = text_type(self.get("TIME", ""))
+ if time.strip("\x00"):
+ self.pop("TIME")
date += "T%s:%s:00" % (time[:2], time[2:])
if "TDRC" not in self:
self.add(TDRC(encoding=0, text=date)) | id3.py: modified TDAT/TYER/TIME upgrade algorithm to work with Python 3. |
diff --git a/test/e2e/hooks_test.go b/test/e2e/hooks_test.go
index <HASH>..<HASH> 100644
--- a/test/e2e/hooks_test.go
+++ b/test/e2e/hooks_test.go
@@ -120,6 +120,7 @@ spec:
}).ExpectWorkflowNode(func(status v1alpha1.NodeStatus) bool {
return strings.Contains(status.Name, "hook")
}, func(t *testing.T, status *v1alpha1.NodeStatus, pod *apiv1.Pod) {
+ t.Skip("https://github.com/argoproj/argo-workflows/issues/8757")
assert.Equal(t, v1alpha1.NodeSucceeded, status.Phase)
})
} | fix: Temporarily fix CI build. Fixes #<I>. (#<I>)
* fix: Temporarily fix CI build |
diff --git a/examples/official-storybook/image-snapshots/storyshots-image.runner.js b/examples/official-storybook/image-snapshots/storyshots-image.runner.js
index <HASH>..<HASH> 100644
--- a/examples/official-storybook/image-snapshots/storyshots-image.runner.js
+++ b/examples/official-storybook/image-snapshots/storyshots-image.runner.js
@@ -20,10 +20,11 @@ if (!fs.existsSync(pathToStorybookStatic)) {
suite: 'Image snapshots',
framework: 'react',
configPath: path.join(__dirname, '..'),
+ storyNameRegex: /^((?!tweaks static values with debounce delay|Inlines component inside story).)$/,
test: imageSnapshot({
storybookUrl: `file://${pathToStorybookStatic}`,
getMatchOptions: () => ({
- failureThreshold: 0.01, // 1% threshold,
+ failureThreshold: 0.04, // 4% threshold,
failureThresholdType: 'percent',
}),
}), | Image snapshots: raise threshold, skip too flaky stories |
diff --git a/src/field.js b/src/field.js
index <HASH>..<HASH> 100644
--- a/src/field.js
+++ b/src/field.js
@@ -363,7 +363,7 @@ export default class Field {
};
} else {
fn = (...args) => {
- if (args.length === 0 || args[0] instanceof Event) {
+ if (args.length === 0 || (isCallable(Event) && args[0] instanceof Event)) {
args[0] = this.value;
}
this.validator.validate(`#${this.id}`, args[0]); | make sure event is a ctor closes #<I> |
diff --git a/examples/wms/script.js b/examples/wms/script.js
index <HASH>..<HASH> 100644
--- a/examples/wms/script.js
+++ b/examples/wms/script.js
@@ -16,7 +16,7 @@ L.tileLayer.wms('http://geodata.havochvatten.se/geoservices/hav-bakgrundskartor/
format: 'image/png',
maxZoom: 14,
minZoom: 0,
- attribution: '© OpenStreetMap <a href="https://www.havochvatten.se/kunskap-om-vara-vatten/kartor-och-geografisk-information/karttjanster.html">Havs- och vattenmyndigheten (Swedish Agency for Marine and Water Management)</a>'
+ attribution: '© OpenStreetMap contributors <a href="https://www.havochvatten.se/kunskap-om-vara-vatten/kartor-och-geografisk-information/karttjanster.html">Havs- och vattenmyndigheten (Swedish Agency for Marine and Water Management)</a>'
}).addTo(map);
map.setView([55.8, 14.3], 3); | change attribution for wms example |
diff --git a/lib/chartkick/helper.rb b/lib/chartkick/helper.rb
index <HASH>..<HASH> 100644
--- a/lib/chartkick/helper.rb
+++ b/lib/chartkick/helper.rb
@@ -74,7 +74,7 @@ module Chartkick
# js vars
js_vars = {
- type: klass, # don't convert to JSON, but still escape
+ type: klass.to_json,
id: element_id.to_json,
data: data_source.respond_to?(:chart_json) ? data_source.chart_json : data_source.to_json,
options: options.to_json
@@ -82,7 +82,7 @@ module Chartkick
js_vars.each_key do |k|
js_vars[k] = chartkick_json_escape(js_vars[k])
end
- createjs = "new Chartkick.%{type}(%{id}, %{data}, %{options});" % js_vars
+ createjs = "new Chartkick[%{type}](%{id}, %{data}, %{options});" % js_vars
if defer
js = <<JS | klass always trusted, but safer pattern |
diff --git a/lib/haibu/drone/drone.js b/lib/haibu/drone/drone.js
index <HASH>..<HASH> 100644
--- a/lib/haibu/drone/drone.js
+++ b/lib/haibu/drone/drone.js
@@ -353,6 +353,7 @@ Drone.prototype._add = function (app, drone, callback) {
//
drone.monitor.on('restart', function (_, data) {
self._update(record, pid, data);
+ pid = data.pid;
});
this._autostartUpdate('add', app, record.drones, callback); | [drone] don't forget to update pid |
diff --git a/spyder_notebook/notebookplugin.py b/spyder_notebook/notebookplugin.py
index <HASH>..<HASH> 100644
--- a/spyder_notebook/notebookplugin.py
+++ b/spyder_notebook/notebookplugin.py
@@ -23,7 +23,7 @@ import nbformat
# Spyder imports
from spyder.config.base import _
from spyder.utils import icon_manager as ima
-from spyder.utils.qthelpers import create_action
+from spyder.utils.qthelpers import create_action, create_toolbutton
from spyder.widgets.tabs import Tabs
from spyder.plugins import SpyderPluginWidget
from spyder.py3compat import to_text_string
@@ -57,7 +57,13 @@ class NotebookPlugin(SpyderPluginWidget):
self.initialize_plugin()
layout = QVBoxLayout()
- self.tabwidget = Tabs(self, self.menu_actions)
+ new_notebook_btn = create_toolbutton(self,
+ icon=ima.icon('project_expanded'),
+ tip=_('Open a new notebook'),
+ triggered=self.create_new_client)
+ corner_widgets = {Qt.TopRightCorner: [new_notebook_btn]}
+ self.tabwidget = Tabs(self, actions=self.menu_actions,
+ corner_widgets=corner_widgets)
if hasattr(self.tabwidget, 'setDocumentMode') \
and not sys.platform == 'darwin':
# Don't set document mode to true on OSX because it generates | Added button to open new notebooks. |
diff --git a/core/src/main/java/com/digitalpebble/stormcrawler/filtering/depth/MaxDepthFilter.java b/core/src/main/java/com/digitalpebble/stormcrawler/filtering/depth/MaxDepthFilter.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/digitalpebble/stormcrawler/filtering/depth/MaxDepthFilter.java
+++ b/core/src/main/java/com/digitalpebble/stormcrawler/filtering/depth/MaxDepthFilter.java
@@ -49,6 +49,7 @@ public class MaxDepthFilter implements URLFilter {
maxDepth = -1;
LOG.warn("maxDepth parameter not found");
}
+ LOG.info("maxDepth set to {}", maxDepth);
}
@Override
@@ -67,12 +68,13 @@ public class MaxDepthFilter implements URLFilter {
return url;
}
- private String filter(int depth, int max, String url) {
+ private String filter(final int depth, final int max, final String url) {
// deactivate the outlink no matter what the depth is
if (max == 0) {
return null;
}
if (depth >= max) {
+ LOG.info("filtered out {} - depth {} >= {}", url, depth, maxDepth);
return null;
}
return url; | minor - addnig more logs to depth filter |
diff --git a/Generator/Tests.php b/Generator/Tests.php
index <HASH>..<HASH> 100644
--- a/Generator/Tests.php
+++ b/Generator/Tests.php
@@ -35,7 +35,7 @@ class Tests extends PHPFile {
$test_file_name = $module_root_name . "Test.php";
// The key is arbitrary (at least so far!).
- $files['module.test'] = array(
+ $files['%module.test'] = array(
'path' => 'src/Tests',
'filename' => $test_file_name,
'body' => $this->file_contents(),
diff --git a/Generator/Tests7.php b/Generator/Tests7.php
index <HASH>..<HASH> 100644
--- a/Generator/Tests7.php
+++ b/Generator/Tests7.php
@@ -21,8 +21,8 @@ class Tests7 extends Tests {
$module_root_name = $this->base_component->component_data['root_name'];
// Change the file location for D7.
- $files['module.test']['path'] = 'tests';
- $files['module.test']['filename'] = "$module_root_name.test";
+ $files['%module.test']['path'] = 'tests';
+ $files['%module.test']['filename'] = "%module.test";
return $files;
} | Changed key in file info array for Tests component to follow de facto pattern. |
diff --git a/src/Http/Controllers/UserController.php b/src/Http/Controllers/UserController.php
index <HASH>..<HASH> 100644
--- a/src/Http/Controllers/UserController.php
+++ b/src/Http/Controllers/UserController.php
@@ -34,16 +34,15 @@ class UserController
*/
public function login($userId, $guard = null)
{
- $model = $this->modelForGuard(
- $guard = $guard ?: config('auth.defaults.guard')
- );
+ $userProvider = Auth::getProvider();
if (str_contains($userId, '@')) {
- $user = (new $model)->where('email', $userId)->first();
+ $user = $userProvider->retrieveByCredentials(['email' => $userId]);
} else {
- $user = (new $model)->find($userId);
+ $user = $userProvider->retrieveById($userId);
}
+ $guard = $guard ?: config('auth.defaults.guard');
Auth::guard($guard)->login($user);
} | Use configured UserProvider instead of Eloquent to retrieve user instance |
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -356,5 +356,8 @@ setup(name='jpy',
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8'
]) | Update supported Python versions in setup.py |
diff --git a/src/state.js b/src/state.js
index <HASH>..<HASH> 100644
--- a/src/state.js
+++ b/src/state.js
@@ -161,7 +161,9 @@ function run(state) {
return state.runChain(SETUP);
}
}).then(function() {
- if (refer.stage) return refer.runChain(CLOSE);
+ if (refer.stage && !samePathname) {
+ return refer.runChain(CLOSE);
+ }
});
}).then(function() {
if (samePathname) { | Do not run close when pathname is the same |
diff --git a/lib/db.js b/lib/db.js
index <HASH>..<HASH> 100644
--- a/lib/db.js
+++ b/lib/db.js
@@ -49,8 +49,8 @@ function updateIndexes(entry, callback)
db.indexes.updated.set(torrent.infoHash, torrent.updated);
if (torrent.files) torrent.files.forEach(function(x) {
getHashes(x).forEach(function(hash) {
- ( (maxSeeders > cfg.minSeedToIndex) ? db.indexes.meta.insert : db.indexes.meta.delete)
- .bind(db.indexes.meta)(hash, torrent.infoHash);
+ db.indexes.meta.delete(hash, torrent.infoHash); // always ensure there are no duplicates
+ if (maxSeeders > cfg.minSeedToIndex) db.indexes.meta.insert(hash, torrent.infoHash);
});
});
callback && callback(); | DB: fix bug with double-indexing torrents |
diff --git a/internal/gamepaddb/gamepaddb.go b/internal/gamepaddb/gamepaddb.go
index <HASH>..<HASH> 100644
--- a/internal/gamepaddb/gamepaddb.go
+++ b/internal/gamepaddb/gamepaddb.go
@@ -14,7 +14,10 @@
// gamecontrollerdb.txt is downloaded at https://github.com/gabomdq/SDL_GameControllerDB.
-//go:generate curl --location --remote-name https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt
+// To update the database file, run:
+//
+// curl --location --remote-name https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt
+
//go:generate file2byteslice -package gamepaddb -input=./gamecontrollerdb.txt -output=./gamecontrollerdb.txt.go -var=gamecontrollerdbTxt
package gamepaddb | internal/gamepaddb: Do not fetch the database file on go:generate
This is too aggressive and sometimes risky to update the database
file always when go-generate is executed. |
diff --git a/tornado/httpserver.py b/tornado/httpserver.py
index <HASH>..<HASH> 100644
--- a/tornado/httpserver.py
+++ b/tornado/httpserver.py
@@ -26,6 +26,7 @@ import logging
import os
import socket
import time
+import urllib
import urlparse
try:
@@ -398,7 +399,8 @@ class HTTPRequest(object):
self._finish_time = None
scheme, netloc, path, query, fragment = urlparse.urlsplit(uri)
- self.path = path
+ self.raw_path = path
+ self.path = urllib.unquote(path)
self.query = query
arguments = cgi.parse_qs(query)
self.arguments = {} | Parse percent escapes in the path component of the uri, to be more
consistent with our handling of query parameters (especially important
when capturing groups are used in the URLSpec regex).
This change is slightly backwards-incompatible: applications that have
already added an unquote() call on arguments to RequestHandler.get/post
or use percent escapes in URLSpec patterns will need to remove them. |
diff --git a/tika/src/main/java/fr/pilato/elasticsearch/crawler/fs/tika/TikaInstance.java b/tika/src/main/java/fr/pilato/elasticsearch/crawler/fs/tika/TikaInstance.java
index <HASH>..<HASH> 100644
--- a/tika/src/main/java/fr/pilato/elasticsearch/crawler/fs/tika/TikaInstance.java
+++ b/tika/src/main/java/fr/pilato/elasticsearch/crawler/fs/tika/TikaInstance.java
@@ -93,14 +93,13 @@ public class TikaInstance {
logger.debug("But Tesseract is not installed so we won't run OCR.");
pdfParser.setOcrStrategy("no_ocr");
}
- defaultParser = new DefaultParser();
+ defaultParser = new DefaultParser(
+ MediaTypeRegistry.getDefaultRegistry(),
+ new ServiceLoader(),
+ Collections.singletonList(PDFParser.class));
}
- Parser PARSERS[] = new Parser[2];
- PARSERS[0] = defaultParser;
- PARSERS[1] = pdfParser;
-
- parser = new AutoDetectParser(PARSERS);
+ parser = new AutoDetectParser(defaultParser, pdfParser);
}
} | Exclude the PDFParser from the DefaultParser
After [a discussion](<URL>) with @tballison, I realized that I did not exclude the PDFParser from the DefaultParser while I'm using a custom AutoDetectParser which is using the DefaultParser and the PDFParser.
This change removes the PDFParser from the DefaultParser. |
diff --git a/holoviews/core/data.py b/holoviews/core/data.py
index <HASH>..<HASH> 100644
--- a/holoviews/core/data.py
+++ b/holoviews/core/data.py
@@ -621,8 +621,6 @@ class DFColumns(DataColumns):
element_kwargs = dict(util.get_param_values(columns),
kdims=element_dims)
element_kwargs.update(kwargs)
- names = [d.name for d in columns.dimensions()
- if d not in dimensions]
map_data = [(k, group_type(v, **element_kwargs))
for k, v in columns.data.groupby(dimensions)]
with item_check(False), sorted_context(False): | Removed unused variable definition in DFColumns.groupby |
diff --git a/library.js b/library.js
index <HASH>..<HASH> 100644
--- a/library.js
+++ b/library.js
@@ -112,7 +112,7 @@ function getGroupMemberUids(groupRecipients, callback) {
return callback(err);
}
async.map(groups, function(group, next) {
- Groups.getMembers(group, next);
+ Groups.getMembers(group, 0, -1, next);
}, function(err, results) {
if (err) {
return callback(err); | getMembers takes start end now |
diff --git a/rqalpha/main.py b/rqalpha/main.py
index <HASH>..<HASH> 100644
--- a/rqalpha/main.py
+++ b/rqalpha/main.py
@@ -335,10 +335,10 @@ def _exception_handler(e):
user_system_log.error(e.error)
if not is_user_exc(e.error.exc_val):
code = const.EXIT_CODE.EXIT_INTERNAL_ERROR
- system_log.exception(_(u"strategy execute exception"))
+ system_log.error(_(u"strategy execute exception"), exc=e)
else:
code = const.EXIT_CODE.EXIT_USER_ERROR
- user_detail_log.exception(_(u"strategy execute exception"))
+ user_detail_log.error(_(u"strategy execute exception"), exc=e)
return code | fix exc_info is replace when trigger __repr__ |
diff --git a/ldapdomaindump/__init__.py b/ldapdomaindump/__init__.py
index <HASH>..<HASH> 100644
--- a/ldapdomaindump/__init__.py
+++ b/ldapdomaindump/__init__.py
@@ -457,7 +457,7 @@ class reportWriter(object):
if attr is None:
return outflags
for flag, val in iteritems(flags_def):
- if attr.value & val:
+ if attr.value != None and attr.value & val:
outflags.append(flag)
return outflags | #<I> Skip flags whose attribute values are of None |
diff --git a/src/SectionField/Generator/EntityGenerator.php b/src/SectionField/Generator/EntityGenerator.php
index <HASH>..<HASH> 100644
--- a/src/SectionField/Generator/EntityGenerator.php
+++ b/src/SectionField/Generator/EntityGenerator.php
@@ -224,6 +224,8 @@ class EntityGenerator extends Generator implements GeneratorInterface
}
}
+ unset($info);
+
usort($this->prePersistInfo, function($a, $b) {
return
$a['config'][self::GENERATE_FOR]['prePersistOrder'] <=> | Fix issue where referenced variable causes issues
<URL> |
diff --git a/Generator/Module.php b/Generator/Module.php
index <HASH>..<HASH> 100644
--- a/Generator/Module.php
+++ b/Generator/Module.php
@@ -338,9 +338,6 @@ class Module extends RootComponent {
// Modules always have a .info file.
$components['info'] = 'Info';
- // TODO: this should only be on D7 and lower.
- $components['%module.module'] = 'ModuleCodeFile';
-
return $components;
}
diff --git a/Generator/Module7.php b/Generator/Module7.php
index <HASH>..<HASH> 100644
--- a/Generator/Module7.php
+++ b/Generator/Module7.php
@@ -24,4 +24,16 @@ class Module7 extends Module {
return $component_data_definition;
}
+ /**
+ * {@inheritdoc}
+ */
+ protected function requiredComponents() {
+ $components = parent::requiredComponents();
+
+ // On D7 and lower, modules need a .module file, even if empty.
+ $components['%module.module'] = 'ModuleCodeFile';
+
+ return $components;
+ }
+
} | Fixed empty .module being generated on D8. |
diff --git a/examples/CustomArrows.js b/examples/CustomArrows.js
index <HASH>..<HASH> 100644
--- a/examples/CustomArrows.js
+++ b/examples/CustomArrows.js
@@ -4,14 +4,26 @@ import Slider from '../src/slider'
var SampleNextArrow = createReactClass({
render: function() {
- return <div {...this.props} style={{display: 'block', background: 'red'}}></div>;
+ const {className, style, onClick} = this.props
+ return (
+ <div
+ className={className}
+ style={{...style, display: 'block', background: 'red'}}
+ onClick={onClick}
+ ></div>
+ );
}
});
var SamplePrevArrow = createReactClass({
render: function() {
+ const {className, style, onClick} = this.props
return (
- <div {...this.props} style={{display: 'block', background: 'red'}}></div>
+ <div
+ className={className}
+ style={{...style, display: 'block', background: 'green'}}
+ onClick={onClick}
+ ></div>
);
}
});
@@ -40,4 +52,4 @@ export default class CustomArrows extends Component {
</div>
);
}
-}
\ No newline at end of file
+} | Fix an issue with custom arrows example |
diff --git a/blockstack/lib/rpc.py b/blockstack/lib/rpc.py
index <HASH>..<HASH> 100644
--- a/blockstack/lib/rpc.py
+++ b/blockstack/lib/rpc.py
@@ -587,10 +587,6 @@ class BlockstackAPIEndpointHandler(SimpleHTTPRequestHandler):
if 'zonefile' in name_rec:
zonefile_txt = base64.b64decode(name_rec['zonefile'])
- res = decode_name_zonefile(name, zonefile_txt)
- if res is None:
- log.error("Failed to parse zone file for {}".format(name))
- zonefile_txt = {'error': 'Non-standard zone file'}
ret = {}
@@ -604,7 +600,7 @@ class BlockstackAPIEndpointHandler(SimpleHTTPRequestHandler):
ret = {
'status': 'registered_subdomain',
'zonefile': zonefile_txt,
- 'zonefile_hash': name_rec['zonefile_hash'],
+ 'zonefile_hash': name_rec['value_hash'],
'address': name_rec['address'],
'blockchain': 'bitcoin',
'last_txid': name_rec['txid'], | don't even try to decode the zone file on GET /v1/names. It's not necessary. |
diff --git a/src/api.js b/src/api.js
index <HASH>..<HASH> 100644
--- a/src/api.js
+++ b/src/api.js
@@ -155,12 +155,8 @@ API.get = function(cfg, name, inheriting) {
API.set = function(cfg, name, value, parentName) {
var api = cfg._fn,
subname = parentName+(name.charAt(0)==='.'?'':'.')+name;
- // always bind functions to the cfg
- if (typeof value === "function") {
- value = value.bind(cfg);
- if (API.get(cfg, 'debug')) {
- value = API.debug(subname, value);
- }
+ if (typeof value === "function" && API.get(cfg, 'debug')) {
+ value = API.debug(subname, value);
}
if (name.charAt(0) === '.') {
api[name.substring(1)] = value;
@@ -217,8 +213,9 @@ API.combine = function(pval, val) {
API.combineFn = function(pfn, fn) {
return function combined(res) {
- //TODO: reconsider whether falsey return values should be respected
- return fn(pfn(res) || res) || res;
+ var ret = pfn.call(this, res);
+ ret = fn.call(this, ret === undefined ? res : ret);
+ return ret === undefined ? res : ret;
};
}; | respect falsey values (except undefined) |
diff --git a/examples/qidle/qidle.py b/examples/qidle/qidle.py
index <HASH>..<HASH> 100644
--- a/examples/qidle/qidle.py
+++ b/examples/qidle/qidle.py
@@ -1,13 +1,13 @@
#! /usr/bin/python3
# -*- coding: utf-8 -*-
+import logging
import sys
+filename = None
+if sys.platform == 'win32':
+ filename = 'qidle.log'
+logging.basicConfig(level=logging.INFO, filename=filename)
from qidle import main
-import logging
if __name__ == '__main__':
- filename = None
- if sys.platform == 'win32':
- filename = 'qidle.log'
- logging.basicConfig(level=logging.INFO, filename=filename)
main() | QIdle: setup logging before importing pyqode
so that the qt api log appears |
diff --git a/javascript/atoms/html5/html5_browser.js b/javascript/atoms/html5/html5_browser.js
index <HASH>..<HASH> 100644
--- a/javascript/atoms/html5/html5_browser.js
+++ b/javascript/atoms/html5/html5_browser.js
@@ -129,7 +129,7 @@ bot.html5.isSupported = function(api, opt_window) {
// supports this.
// Geolocation doesn't respond on Safari5 on Windows, see:
// https://discussions.apple.com/thread/3547900
- if (bot.html5.IS_FF_3_OR_4_ || bot.html5.IS_SAFARI5_WINDOWS_) {
+ if (goog.userAgent.GECKO || bot.html5.IS_SAFARI5_WINDOWS_) {
return false;
}
return goog.isDefAndNotNull(win.navigator) && | SimonStewart: Ignore geo tests for all versions of Firefox until we know how to enable them without prompting the user.
r<I> |
diff --git a/marrow/schema/compat.py b/marrow/schema/compat.py
index <HASH>..<HASH> 100644
--- a/marrow/schema/compat.py
+++ b/marrow/schema/compat.py
@@ -2,10 +2,15 @@
import sys
-if sys.version_info > (3, ): # pragma: no cover
+py2 = sys.version_info < (3, )
+py3 = sys.version_info > (3, )
+
+if py3: # pragma: no cover
unicode = str
str = bytes
else: # pragma: no cover
+ unicode = unicode
+ str = str
range = xrange
try: # pragma: no cover | Added simple boolean helpers and added missing builtins. |
diff --git a/algoliasearch/index_iterator.go b/algoliasearch/index_iterator.go
index <HASH>..<HASH> 100644
--- a/algoliasearch/index_iterator.go
+++ b/algoliasearch/index_iterator.go
@@ -28,7 +28,6 @@ func (it *indexIterator) Next() (res Map, err error) {
// Abort if the user call `Next()` on a IndexIterator that has been
// initialized without being able to load the first page.
if len(it.page.Hits) == 0 {
- //err = errors.New("No more hits")
err = NoMoreHitsErr
return
}
@@ -38,7 +37,6 @@ func (it *indexIterator) Next() (res Map, err error) {
// been returned.
if it.pos == len(it.page.Hits) {
if it.cursor == "" {
- //err = errors.New("No more hits")
err = NoMoreHitsErr
} else {
err = it.loadNextPage()
@@ -64,7 +62,6 @@ func (it *indexIterator) loadNextPage() (err error) {
// Return an error if the newly loaded pages contains no results
if len(it.page.Hits) == 0 {
- //err = errors.New("No more hits")
err = NoMoreHitsErr
return
} | refactor: Remove commented dead code |
diff --git a/spec/network/tcp_spec.rb b/spec/network/tcp_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/network/tcp_spec.rb
+++ b/spec/network/tcp_spec.rb
@@ -113,13 +113,13 @@ describe Network::TCP do
end
describe "#tcp_banner" do
- let(:host) { 'smtp.gmail.com' }
- let(:port) { 25 }
+ let(:host) { 'smtp.gmail.com' }
+ let(:port) { 25 }
let(:local_port) { 1024 + rand(65535 - 1024) }
let(:expected_banner) { /^220 mx\.google\.com ESMTP/ }
- it "should read the service banner" do
+ it "should return the read service banner" do
banner = subject.tcp_banner(host,port)
banner.should =~ expected_banner
@@ -140,6 +140,25 @@ describe Network::TCP do
banner.should =~ expected_banner
end
+
+ context "when no banner could be read" do
+ let(:bad_host) { 'localhost' }
+ let(:bad_port) { 1337 }
+
+ it "should return nil" do
+ subject.tcp_banner(bad_host,bad_port).should == nil
+ end
+
+ it "should not yield anything" do
+ yielded = false
+
+ subject.tcp_banner(bad_host,bad_port) do |banner|
+ yielded = true
+ end
+
+ yielded.should == false
+ end
+ end
end
describe "#tcp_send" do | Add specs for when no banner could be read. |
diff --git a/models/classes/runner/QtiRunnerServiceContext.php b/models/classes/runner/QtiRunnerServiceContext.php
index <HASH>..<HASH> 100644
--- a/models/classes/runner/QtiRunnerServiceContext.php
+++ b/models/classes/runner/QtiRunnerServiceContext.php
@@ -143,11 +143,6 @@ class QtiRunnerServiceContext extends RunnerServiceContext
*/
public function init()
{
- // code borrowed from the previous implementation, maybe obsolete...
- /** @var SessionStateService $sessionStateService */
- $sessionStateService = $this->getServiceManager()->get(SessionStateService::SERVICE_ID);
- $sessionStateService->resumeSession($this->getTestSession());
-
$this->retrieveItemIndex();
} | Do not resume paused session on runner actions |
diff --git a/lib/hamlit/attribute_builder.rb b/lib/hamlit/attribute_builder.rb
index <HASH>..<HASH> 100644
--- a/lib/hamlit/attribute_builder.rb
+++ b/lib/hamlit/attribute_builder.rb
@@ -80,7 +80,12 @@ module Hamlit::AttributeBuilder
def build_data_attribute(key, escape_attrs, quote, *hashes)
attrs = []
- hash = flatten_attributes(key => hashes.first)
+ if hashes.size > 1 && hashes.all? { |h| h.is_a?(Hash) }
+ data_value = merge_all_attrs(hashes)
+ else
+ data_value = hashes.last
+ end
+ hash = flatten_attributes(key => data_value)
hash.sort_by(&:first).each do |key, value|
case value | Deal with multiple data attrs correctly |
diff --git a/lxd/device/disk.go b/lxd/device/disk.go
index <HASH>..<HASH> 100644
--- a/lxd/device/disk.go
+++ b/lxd/device/disk.go
@@ -69,7 +69,7 @@ type diskSourceNotFoundError struct {
}
func (e diskSourceNotFoundError) Error() string {
- return e.msg
+ return fmt.Sprintf("%s: %v", e.msg, e.err)
}
func (e diskSourceNotFoundError) Unwrap() error { | lxd/device/disk: Included wrapped error in diskSourceNotFoundError |
diff --git a/tests/test_stemmers.py b/tests/test_stemmers.py
index <HASH>..<HASH> 100644
--- a/tests/test_stemmers.py
+++ b/tests/test_stemmers.py
@@ -44,3 +44,10 @@ def test_slovak_stemmer():
assert type(actual) is type(expected)
assert expected.__dict__ == actual.__dict__
+
+
+def test_greek_stemmer():
+ greek_stemmer = Stemmer("greek")
+ # The first assert covers the empty stem case.
+ assert "οτ" == greek_stemmer("όταν")
+ assert "εργαζ" == greek_stemmer("εργαζόμενος") | Add test that reproduces the empty stem bug in the greek stemmer |
diff --git a/pachyderm/generic_config.py b/pachyderm/generic_config.py
index <HASH>..<HASH> 100644
--- a/pachyderm/generic_config.py
+++ b/pachyderm/generic_config.py
@@ -350,7 +350,6 @@ def unrollNestedDict(d, keys = None):
As an example, consider the input:
- ```
>>> d = {
... "a1" : {
... "b" : {
@@ -372,7 +371,6 @@ def unrollNestedDict(d, keys = None):
>>> next(unroll) == (["a1", "b", "c12"], "obj2")
...
>>> next(unroll) == (["a2", "b", "c3"], "obj3") # Last result.
- ```
Args:
d (dict): Analysis dictionary to unroll (flatten) | Fix docs formatting
It wasn't displaying correctly due to the mix of md and rst |
diff --git a/libnetwork/controller.go b/libnetwork/controller.go
index <HASH>..<HASH> 100644
--- a/libnetwork/controller.go
+++ b/libnetwork/controller.go
@@ -801,7 +801,7 @@ func (c *controller) NewSandbox(containerID string, options ...SandboxOption) (s
// If not a stub, then we already have a complete sandbox.
if !s.isStub {
c.Unlock()
- return nil, types.BadRequestErrorf("container %s is already present: %v", containerID, s)
+ return nil, types.ForbiddenErrorf("container %s is already present: %v", containerID, s)
}
// We already have a stub sandbox from the
@@ -836,7 +836,7 @@ func (c *controller) NewSandbox(containerID string, options ...SandboxOption) (s
c.Lock()
if sb.ingress && c.ingressSandbox != nil {
c.Unlock()
- return nil, fmt.Errorf("ingress sandbox already present")
+ return nil, types.ForbiddenErrorf("ingress sandbox already present")
}
if sb.ingress { | Return proper error types on sandbox creation |
diff --git a/tests/conftest.py b/tests/conftest.py
index <HASH>..<HASH> 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -70,7 +70,7 @@ def spoof(tmpdir_factory, **kwargs):
"""
env = os.environ.copy()
slug = '-'.join(v.replace('.py', '') for v in sorted(kwargs.values()))
- spoofer_base = Path(tmpdir_factory.mktemp('spoofers'))
+ spoofer_base = Path(str(tmpdir_factory.mktemp('spoofers')))
tmpdir = spoofer_base / slug
tmpdir.mkdir(parents=True) | conftest: py<I> path issue |
diff --git a/provision/provisiontest/fake_provisioner.go b/provision/provisiontest/fake_provisioner.go
index <HASH>..<HASH> 100644
--- a/provision/provisiontest/fake_provisioner.go
+++ b/provision/provisiontest/fake_provisioner.go
@@ -53,6 +53,7 @@ func NewFakeApp(name, platform string, units int) *FakeApp {
platform: platform,
units: make([]provision.Unit, units),
instances: make(map[string][]bind.ServiceInstance),
+ Processes: map[string]string{"web": fmt.Sprintf("%s %s.sh", platform, name)},
}
namefmt := "%s-%d"
for i := 0; i < units; i++ { | provision/provisiontest: adding default processes to a fake app |
diff --git a/scserver.js b/scserver.js
index <HASH>..<HASH> 100644
--- a/scserver.js
+++ b/scserver.js
@@ -877,7 +877,10 @@ SCServer.prototype._passThroughHandshakeSCMiddleware = function (options, cb) {
statusCode = 4008;
}
if (err) {
- if (err === true) {
+ if (err.statusCode != null) {
+ statusCode = err.statusCode;
+ }
+ if (err === true || err.silent) {
err = new SilentMiddlewareBlockedError('Action was silently blocked by ' + self.MIDDLEWARE_HANDSHAKE_SC + ' middleware', self.MIDDLEWARE_HANDSHAKE_SC);
} else if (self.middlewareEmitWarnings) {
self.emit('warning', err); | Add support for custom disconnect status code in handshake middleware when using async function |
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -63,7 +63,7 @@ module.exports = function dnsmonctor(cfg, cb) {
function(err, oldrecords) { if (err) return cb(err);
// If the old ones aren't the same as the new ones
- if (!equal(records,JSON.parse(oldrecords))) {
+ if (!(oldrecords && equal(records,JSON.parse(oldrecords)))) {
// Mark this domain as processing
db.eval(hshd,2,'processing_domains','querying_domains', | Handle processing of first-time records |
diff --git a/torchvision/datasets/cifar.py b/torchvision/datasets/cifar.py
index <HASH>..<HASH> 100644
--- a/torchvision/datasets/cifar.py
+++ b/torchvision/datasets/cifar.py
@@ -128,9 +128,9 @@ class CIFAR10(data.Dataset):
def __len__(self):
if self.train:
- return 50000
+ return len(self.train_data)
else:
- return 10000
+ return len(self.test_data)
def _check_integrity(self):
root = self.root | Cifar also returns real data length (#<I>) |
diff --git a/cpt/__init__.py b/cpt/__init__.py
index <HASH>..<HASH> 100644
--- a/cpt/__init__.py
+++ b/cpt/__init__.py
@@ -1,5 +1,5 @@
-__version__ = '0.32.0-dev'
+__version__ = '0.31.0'
NEWEST_CONAN_SUPPORTED = "1.22.000" | Bump CPT version to <I> |
diff --git a/mbuild/bond.py b/mbuild/bond.py
index <HASH>..<HASH> 100755
--- a/mbuild/bond.py
+++ b/mbuild/bond.py
@@ -46,18 +46,10 @@ class Bond(object):
def atom1(self):
return self._atom1
- @atom1.setter
- def atom1(self, v):
- raise TypeError # what's going on here?
-
@property
def atom2(self):
return self._atom2
- @atom2.setter
- def atom2(self, v):
- raise TypeError
-
def ancestors(self):
"""Generate all ancestors of the Compound recursively. | bond's atom1 and atom2 properties are read-only |
diff --git a/plugin/geomajas-plugin-rasterizing/rasterizing/src/main/java/org/geomajas/plugin/rasterizing/RasterizingController.java b/plugin/geomajas-plugin-rasterizing/rasterizing/src/main/java/org/geomajas/plugin/rasterizing/RasterizingController.java
index <HASH>..<HASH> 100644
--- a/plugin/geomajas-plugin-rasterizing/rasterizing/src/main/java/org/geomajas/plugin/rasterizing/RasterizingController.java
+++ b/plugin/geomajas-plugin-rasterizing/rasterizing/src/main/java/org/geomajas/plugin/rasterizing/RasterizingController.java
@@ -41,14 +41,10 @@ public class RasterizingController {
@Autowired
private ConfigurationService configurationService;
- @RequestMapping(value = "/rasterizing/{layerId}/{key}.{format}", method = RequestMethod.GET)
+ @RequestMapping(value = "/rasterizing/{layerId}/{key}.png", method = RequestMethod.GET)
public void getWms(@PathVariable String layerId, @PathVariable String key,
HttpServletResponse response) throws Exception {
-// // Search for the WMS layer:
-// String layer = parseLayer(request);
-// String key = parseKey(request);
-
try {
PipelineContext context = pipelineService.createContext();
context.put(RasterizingPipelineCode.IMAGE_ID_KEY, key); | RAST-3 always png, remove commented code |
diff --git a/src/Controller/Component/PostTypesComponent.php b/src/Controller/Component/PostTypesComponent.php
index <HASH>..<HASH> 100644
--- a/src/Controller/Component/PostTypesComponent.php
+++ b/src/Controller/Component/PostTypesComponent.php
@@ -127,8 +127,8 @@ class PostTypesComponent extends Component
'name' => ucfirst(Inflector::slug(pluginSplit($model)[1])),
'alias' => ucfirst(Inflector::humanize(pluginSplit($model)[1])),
'aliasLc' => lcfirst(Inflector::humanize(pluginSplit($model)[1])),
- 'singluarAlias' => ucfirst(Inflector::singularize(Inflector::humanize(pluginSplit($model)[1]))),
- 'singluarAliasLc' => lcfirst(Inflector::singularize(Inflector::humanize(pluginSplit($model)[1]))),
+ 'singularAlias' => ucfirst(Inflector::singularize(Inflector::humanize(pluginSplit($model)[1]))),
+ 'singularAliasLc' => lcfirst(Inflector::singularize(Inflector::humanize(pluginSplit($model)[1]))),
'description' => null,
'actions' => [
'index' => true, | Typo in singularAlias |
diff --git a/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/internal/hpel/HpelBaseTraceService.java b/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/internal/hpel/HpelBaseTraceService.java
index <HASH>..<HASH> 100644
--- a/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/internal/hpel/HpelBaseTraceService.java
+++ b/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/internal/hpel/HpelBaseTraceService.java
@@ -119,8 +119,14 @@ public class HpelBaseTraceService extends BaseTraceService {
//but the results of this call are not actually used anywhere (for traces), so it can be disabled for now
//String traceDetail = formatter.traceLogFormat(logRecord, id, formattedMsg, formattedVerboseMsg);
invokeTraceRouters(routedTrace);
- if (traceSource != null) {
- traceSource.publish(routedTrace, id);
+ try {
+ if (!(counterForTraceSource.incrementCount() > 2)) {
+ if (traceSource != null) {
+ traceSource.publish(routedTrace, id);
+ }
+ }
+ } finally {
+ counterForTraceRouter.decrementCount();
}
trWriter.repositoryPublish(logRecord);
} | Add recursion counters to avoid infinite loop in trace for hpelbts |
diff --git a/timeside/server/models.py b/timeside/server/models.py
index <HASH>..<HASH> 100644
--- a/timeside/server/models.py
+++ b/timeside/server/models.py
@@ -209,6 +209,7 @@ class UUID(models.Model):
created = True
return obj, created
+
@classmethod
def get_first(cls, **kwargs):
"""
@@ -580,13 +581,6 @@ class Item(Titled, UUID, Dated, Shareable):
# item.lock_setter(True)
- if not self.hdf5:
- hdf5_file = str(experience.uuid) + '.hdf5'
- self.hdf5 = os.path.join(
- result_path, hdf5_file
- ).replace(settings.MEDIA_ROOT, '')
- self.save()
-
pipe.run()
def set_results_from_processor(proc, preset=None):
@@ -1098,6 +1092,11 @@ class AnalysisTrack(Titled, UUID, Dated, Shareable):
blank=False,
on_delete=models.CASCADE
)
+ color = models.CharField(
+ _('RVB color'),
+ max_length=6,
+ blank=True
+ )
class Meta:
verbose_name = _('Analysis Track') | [server] avoid hdf5 storage in Item |
diff --git a/tests/ConfigServiceProviderTest.php b/tests/ConfigServiceProviderTest.php
index <HASH>..<HASH> 100644
--- a/tests/ConfigServiceProviderTest.php
+++ b/tests/ConfigServiceProviderTest.php
@@ -95,10 +95,12 @@ class ConfigServiceProviderTest extends TestCase
{
$root = realpath(__DIR__ . '/..');
+ putenv('APP_ENV=true');
putenv('DATABASE_URL=mysql://localhost:3306');
putenv('ROOT_PATH=%ROOT_PATH%');
$this->createFile('env.json', null, json_encode([
+ 'debug' => '%env(bool:APP_ENV)%',
'db.dsn' => '%env(string:DATABASE_URL)%',
'root.path' => '%env(string:ROOT_PATH)%',
], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR));
@@ -109,6 +111,7 @@ class ConfigServiceProviderTest extends TestCase
['ROOT_PATH' => $root]
));
+ self::assertTrue($app['debug']);
self::assertSame('mysql://localhost:3306', $app['db.dsn']);
self::assertSame($root, $app['root.path']);
} | Testing resolve of non string environment vars |
diff --git a/src/errors/command-format.js b/src/errors/command-format.js
index <HASH>..<HASH> 100644
--- a/src/errors/command-format.js
+++ b/src/errors/command-format.js
@@ -10,11 +10,11 @@ class CommandFormatError extends FriendlyError {
*/
constructor(msg) {
super(
- `Invalid command format. Use ${msg.anyUsage(
- `help ${msg.command.name}`,
+ `Invalid command format. Please use the proper format, ${msg.usage(
+ msg.command.format,
msg.guild ? undefined : null,
msg.guild ? undefined : null
- )} for information.`
+ )}.`
);
this.name = 'CommandFormatError';
} | Make CommandFormatError more descriptive |
diff --git a/cast_test.go b/cast_test.go
index <HASH>..<HASH> 100644
--- a/cast_test.go
+++ b/cast_test.go
@@ -53,7 +53,7 @@ func TestToBool(t *testing.T) {
assert.Equal(t, ToBool("F"), false)
assert.Equal(t, ToBool(false), false)
assert.Equal(t, ToBool("foo"), false)
-
+
assert.Equal(t, ToBool("true"), true)
assert.Equal(t, ToBool("TRUE"), true)
assert.Equal(t, ToBool("True"), true)
@@ -61,4 +61,5 @@ func TestToBool(t *testing.T) {
assert.Equal(t, ToBool("T"), true)
assert.Equal(t, ToBool(1), true)
assert.Equal(t, ToBool(true), true)
+ assert.Equal(t, ToBool(-1), true)
}
diff --git a/caste.go b/caste.go
index <HASH>..<HASH> 100644
--- a/caste.go
+++ b/caste.go
@@ -41,7 +41,7 @@ func ToBoolE(i interface{}) (bool, error) {
case nil:
return false, nil
case int:
- if i.(int) > 0 {
+ if i.(int) != 0 {
return true, nil
}
return false, nil | Updated to return bool false only for zero |
diff --git a/symphony/lib/toolkit/fields/field.taglist.php b/symphony/lib/toolkit/fields/field.taglist.php
index <HASH>..<HASH> 100644
--- a/symphony/lib/toolkit/fields/field.taglist.php
+++ b/symphony/lib/toolkit/fields/field.taglist.php
@@ -91,7 +91,7 @@ class FieldTagList extends Field implements ExportableField, ImportableField
public function fetchAssociatedEntryCount($value)
{
- $value = array_map(trim, array_map([$this, 'cleanValue'], explode(',', $value)));
+ $value = array_map('trim', array_map([$this, 'cleanValue'], explode(',', $value)));
return (int)Symphony::Database()
->select() | Make sure array_map does not create warnings
In PHP7, passing a global function results in passing a undefined
constant, which is then turned into a string, which then works with
array_map.
It is best to remove this and directly pass a string or a lambda.
Fixes #<I>
Picked from 4d<I>a<I>
Picked from abf<I> |
diff --git a/pyinfra/facts/apt.py b/pyinfra/facts/apt.py
index <HASH>..<HASH> 100644
--- a/pyinfra/facts/apt.py
+++ b/pyinfra/facts/apt.py
@@ -95,7 +95,7 @@ class DebPackage(FactBase):
_regexes = {
'name': r'^Package: ([a-zA-Z0-9\-]+)$',
- 'version': r'^Version: ([0-9\.\-]+)$',
+ 'version': r'^Version: ([0-9\:\.\-]+)$',
}
def command(self, name):
diff --git a/pyinfra/modules/apt.py b/pyinfra/modules/apt.py
index <HASH>..<HASH> 100644
--- a/pyinfra/modules/apt.py
+++ b/pyinfra/modules/apt.py
@@ -162,7 +162,7 @@ def deb(state, host, source, present=True, force=False):
if (
info['name'] in current_packages
- and info['version'] in current_packages[info['name']]
+ and info.get('version') in current_packages[info['name']]
):
exists = True | Add : to apt regex versioning search and don't fail with no version
Some versions include colons and these were ignored by the regex
If no version was found then the the module would fail- by doing get
this is avoided |
diff --git a/test/status_builder_test.rb b/test/status_builder_test.rb
index <HASH>..<HASH> 100644
--- a/test/status_builder_test.rb
+++ b/test/status_builder_test.rb
@@ -268,6 +268,24 @@ def test_rev_history_status_merge_commit_bypass_remote_branch
end
end
+def test_status_works_on_bare_repository
+ src = empty_test_dir("rim_info")
+ RIM.git_session(src) do |s|
+ test_git_setup(s, src)
+ end
+ d = empty_test_dir("rim_info_bare")
+ RIM.git_session(d) do |s|
+ s.execute("git clone --bare file://#{src} .")
+ rs = RIM::StatusBuilder.new.rev_status(s, "mod1")
+ assert_equal s.rev_sha1("mod1"), rs.git_rev
+ assert_equal [], rs.parents
+ assert_equal 1, rs.modules.size
+ assert rs.modules.all?{|m| !m.dirty?}
+ assert_equal "ssh://gerrit-test/mod1", rs.modules.find{|m| m.dir == "mod1"}.rim_info.remote_url
+ end
+
+end
+
def teardown
# clean up test dirs created during last test
remove_test_dirs | Added test for status on bare repository. |
diff --git a/screamshot/utils.py b/screamshot/utils.py
index <HASH>..<HASH> 100644
--- a/screamshot/utils.py
+++ b/screamshot/utils.py
@@ -13,7 +13,7 @@ except ImportError:
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.core.urlresolvers import reverse
from django.core.validators import URLValidator
-from io import StringIO
+from io import BytesIO
from django.template.loader import render_to_string
from django.conf import settings
@@ -339,7 +339,7 @@ def render_template(template_name, context, format='png',
file object of the result.
"""
# output stream, as required by casperjs_capture
- stream = StringIO()
+ stream = BytesIO()
out_f = None
# the suffix=.html is a hack for phantomjs which *will*
# complain about not being able to open source file
@@ -359,7 +359,7 @@ def render_template(template_name, context, format='png',
static_url,
'file://%s' % settings.STATIC_ROOT
)
- render_file.write(template_content)
+ render_file.write(template_content.encode('utf-8'))
# this is so that the temporary file actually gets filled
# with the result.
render_file.seek(0) | Fixes for rendering templates (library-usage):
- use BytesIO instead of StringIO (python was complaining about bytes)
- encode the middleware template to utf-8 |
diff --git a/src/ImageShortcodeHandler.php b/src/ImageShortcodeHandler.php
index <HASH>..<HASH> 100644
--- a/src/ImageShortcodeHandler.php
+++ b/src/ImageShortcodeHandler.php
@@ -72,7 +72,10 @@ class ImageShortcodeHandler
$density = (int)$density;
$resized = $record->ResizedImage((int)ceil($width * $density), (int)ceil($height * $density));
// Output in the format "assets/foo.jpg 1x"
- $srcsetSources[] = $resized->getURL() . " {$density}x";
+ $resizedUrl = $resized->getURL();
+ if ($resizedUrl) {
+ $srcsetSources[] = $resizedUrl . " {$density}x";
+ }
}
} | FIX: Prevent fatal errors when assets are missing |
diff --git a/dpark/pymesos/scheduler.py b/dpark/pymesos/scheduler.py
index <HASH>..<HASH> 100644
--- a/dpark/pymesos/scheduler.py
+++ b/dpark/pymesos/scheduler.py
@@ -59,6 +59,7 @@ class MesosSchedulerDriver(Process):
@async # called by detector
def onNewMasterDetectedMessage(self, pid):
self.master = UPID(pid)
+ self.connected = False
self.register()
@async # called by detector | fix re-register to master after failover |
diff --git a/src/models/elements.model.mongodb.js b/src/models/elements.model.mongodb.js
index <HASH>..<HASH> 100644
--- a/src/models/elements.model.mongodb.js
+++ b/src/models/elements.model.mongodb.js
@@ -6,6 +6,8 @@ module.exports = function (forecast, element, app, options) {
options.Model.ensureIndex({ forecastTime: 1 }, { expireAfterSeconds: element.interval || forecast.interval })
// To perform geo queries on tiles
options.Model.ensureIndex({ geometry: '2dsphere' })
+ // To perform $exists requests
+ options.Model.ensureIndex({ geometry: 1 })
options.Model.ensureIndex({ x: 1, y: 1 })
options.Model.ensureIndex({ forecastTime: 1, geometry: 1 })
} | Added standard index on element geometry to increase performances |
diff --git a/src/DatabaseQuery.php b/src/DatabaseQuery.php
index <HASH>..<HASH> 100644
--- a/src/DatabaseQuery.php
+++ b/src/DatabaseQuery.php
@@ -1419,7 +1419,7 @@ abstract class DatabaseQuery
* @param mixed $conditions A string or array of WHERE conditions.
* @param string $innerGlue The glue by which to join the conditions. Defaults to AND.
*
- * @return DatabaseQuery Returns this object to allow chaining.
+ * @return $this
*
* @since 1.3.0
*/
@@ -1444,7 +1444,7 @@ abstract class DatabaseQuery
* @param mixed $conditions A string or array of WHERE conditions.
* @param string $glue The glue by which to join the conditions. Defaults to AND.
*
- * @return DatabaseQuery Returns this object to allow chaining.
+ * @return $this
*
* @since 1.3.0
*/
@@ -1463,7 +1463,7 @@ abstract class DatabaseQuery
* @param mixed $conditions A string or array of WHERE conditions.
* @param string $glue The glue by which to join the conditions. Defaults to OR.
*
- * @return DatabaseQuery Returns this object to allow chaining.
+ * @return $this
*
* @since 1.3.0
*/
diff --git a/src/Query/QueryElement.php b/src/Query/QueryElement.php
index <HASH>..<HASH> 100644
--- a/src/Query/QueryElement.php
+++ b/src/Query/QueryElement.php
@@ -116,7 +116,7 @@ class QueryElement
*
* @param string $name Name of the element.
*
- * @return QueryElement Returns this object to allow chaining.
+ * @return $this
*
* @since 1.3.0
*/ | Update doc blocks to match other changes |
diff --git a/fuse.py b/fuse.py
index <HASH>..<HASH> 100644
--- a/fuse.py
+++ b/fuse.py
@@ -383,7 +383,9 @@ def time_of_timespec(ts):
def set_st_attrs(st, attrs):
for key, val in attrs.items():
if key in ('st_atime', 'st_mtime', 'st_ctime', 'st_birthtime'):
- timespec = getattr(st, key + 'spec')
+ timespec = getattr(st, key + 'spec', None)
+ if timespec is None:
+ continue
timespec.tv_sec = int(val)
timespec.tv_nsec = int((val - timespec.tv_sec) * 10 ** 9)
elif hasattr(st, key): | Ignore input time field if it doesn't exist on stat |
diff --git a/ClosureCompiler.js b/ClosureCompiler.js
index <HASH>..<HASH> 100644
--- a/ClosureCompiler.js
+++ b/ClosureCompiler.js
@@ -156,7 +156,10 @@
delete options["js"];
delete options["js_output_file"];
- var args = '-client -jar "'+__dirname+'/compiler/compiler.jar"'; // -d32 does not work on 64bit
+ // -XX:+TieredCompilation speeds up compilation for Java 1.7.
+ // Previous -d32 was for Java 1.6 only.
+ // Compiler now requires Java 1.7 and this flag does not need detection.
+ var args = '-XX:+TieredCompilation -jar "'+__dirname+'/compiler/compiler.jar"';
// Source files
if (!(files instanceof Array)) { | Speed up compiler compilation for Java <I>
Manually tested on Mac, Win, Linux platforms. |
diff --git a/packages/d3fc-data-join/src/dataJoin.js b/packages/d3fc-data-join/src/dataJoin.js
index <HASH>..<HASH> 100644
--- a/packages/d3fc-data-join/src/dataJoin.js
+++ b/packages/d3fc-data-join/src/dataJoin.js
@@ -23,9 +23,8 @@ export default (element, className) => {
const dataJoin = function(container, data) {
data = data || ((d) => d);
- const selector = className == null ? element : `${element}.${className}`;
- const selected = container.selectAll(selector)
- .filter((d, i, nodes) => nodes[i].parentNode === container.node());
+ const selected = container.selectAll((d, i, nodes) => nodes[i].children)
+ .filter(className == null ? element : `${element}.${className}`);
let update = selected.data(data, key);
// N.B. insert() is used to create new elements, rather than append(). insert() behaves in a special manner | refactor: improve performance of child-only selector
Select children then post-filter to matching selector rather than select all matching descendents then post-filter to children. |
diff --git a/webapps/webapp/src/main/webapp/app/tasklist/services/EngineApi.js b/webapps/webapp/src/main/webapp/app/tasklist/services/EngineApi.js
index <HASH>..<HASH> 100644
--- a/webapps/webapp/src/main/webapp/app/tasklist/services/EngineApi.js
+++ b/webapps/webapp/src/main/webapp/app/tasklist/services/EngineApi.js
@@ -16,7 +16,7 @@ ngDefine('tasklist.services', [
var forms = $resource(Uri.appUri("engine://engine/:engine/:context/:id/:action"), { id: "@id" } , {
startForm : { method: 'GET', params : { context: "process-definition", action: 'startForm' }},
- taskForm : { method: 'GET', params : { context: "task" }}
+ taskForm : { method: 'GET', params : { context: "task", action: 'form' }}
});
this.taskList.getForm = function(data, fn) { | fix(tasklist): resolve task form using correct uri
Related to CAM-<I> |
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -5,15 +5,16 @@ See LICENSE at the top-level of this distribution for more information
or write to emin.martinian@gmail.com for more information.
"""
-from setuptools import setup, find_packages
from os import path
+from setuptools import setup, find_packages
+
def get_readme():
'Get the long description from the README file'
here = path.abspath(path.dirname(__file__))
- with open(path.join(here, 'README.md'), encoding='utf-8') as f:
- result = f.read()
+ with open(path.join(here, 'README.md'), encoding='utf-8') as my_fd:
+ result = my_fd.read()
return result
setup(
@@ -30,7 +31,7 @@ setup(
'Intended Audience :: Developers',
'Programming Language :: Python :: 3',
],
- keywords='comment management',
+ keywords='comment management',
# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
packages=find_packages(exclude=['contrib', 'docs', 'tests']), | Cleaned up pylint warnings |
diff --git a/pages/models.py b/pages/models.py
index <HASH>..<HASH> 100644
--- a/pages/models.py
+++ b/pages/models.py
@@ -144,6 +144,8 @@ if settings.PAGE_PERMISSION:
def get_page_id_list(cls, user):
"""Give a list of page where the user as rights or the string "All" if
the user has all rights."""
+ if user.is_superuser:
+ return 'All'
id_list = []
perms = PagePermission.objects.filter(user=user)
for perm in perms: | The admin user can now do everything : PagePermission is ignored for him
git-svn-id: <URL> |
diff --git a/tests/utils.py b/tests/utils.py
index <HASH>..<HASH> 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -7,6 +7,7 @@ from collections import Mapping
from urllib.parse import urlparse
import redis
+from hestia.auth import AuthenticationTypes
from mock import patch
from rest_framework import status
@@ -97,7 +98,11 @@ class BaseClient(Client):
class EphemeralClient(BaseClient):
- def __init__(self, token, authentication_type='EphemeralToken', service=None, **defaults):
+ def __init__(self,
+ token,
+ authentication_type=AuthenticationTypes.EPHEMERAL_TOKEN,
+ service=None,
+ **defaults):
super().__init__(**defaults)
self.service = service or settings.EPHEMERAL_SERVICES.RUNNER
self.authorization_header = '{} {}'.format(authentication_type, token) | Update ephemeral client |
diff --git a/src/cornerstone/seoAssessor.js b/src/cornerstone/seoAssessor.js
index <HASH>..<HASH> 100644
--- a/src/cornerstone/seoAssessor.js
+++ b/src/cornerstone/seoAssessor.js
@@ -66,7 +66,6 @@ const CornerstoneSEOAssessor = function( i18n, options ) {
recommendedMinimum: 900,
slightlyBelowMinimum: 400,
belowMinimum: 300,
- farBelowMinimum: 0,
scores: {
belowMinimum: -20, | Remove the passing of a non-existing config value |
diff --git a/sanic/request.py b/sanic/request.py
index <HASH>..<HASH> 100644
--- a/sanic/request.py
+++ b/sanic/request.py
@@ -312,11 +312,11 @@ def parse_multipart_form(body, boundary):
if field_name:
post_data = form_part[line_index:-4]
if file_name:
- file = File(type=content_type, name=file_name, body=post_data)
+ form_file = File(type=content_type, name=file_name, body=post_data)
if field_name in files:
- files[field_name].append(file)
+ files[field_name].append(form_file)
else:
- files[field_name] = [file]
+ files[field_name] = [form_file]
else:
value = post_data.decode(content_charset)
if field_name in fields: | changed 'file' variable to 'form_file' to prevent overwriting the reserved word |
diff --git a/salt/runners/vault.py b/salt/runners/vault.py
index <HASH>..<HASH> 100644
--- a/salt/runners/vault.py
+++ b/salt/runners/vault.py
@@ -55,6 +55,9 @@ def generate_token(minion_id, signature, impersonated_by_master=False):
'num_uses': 1,
'metadata': audit_data
}
+
+ if payload['policies'] == []:
+ return {'error': 'No policies matched minion'}
log.trace('Sending token creation request to Vault')
response = requests.post(url, headers=headers, json=payload) | Fix bug with vault runner creating token on empty policy |
diff --git a/js/lib/mediawiki.WikitextSerializer.js b/js/lib/mediawiki.WikitextSerializer.js
index <HASH>..<HASH> 100644
--- a/js/lib/mediawiki.WikitextSerializer.js
+++ b/js/lib/mediawiki.WikitextSerializer.js
@@ -1480,6 +1480,14 @@ WSP._serializeToken = function ( state, token ) {
if (! dropContent || ! state.dropContent ) {
var newTrailingNLCount = 0;
+
+ // FIXME: figure out where the non-string res comes from
+ if (res !== '' && res.constructor !== String) {
+ console.err("res was not a string!");
+ console.trace();
+ res = '';
+ }
+
if (res !== '') {
// Strip leading or trailing newlines from the returned string
var match = res.match( /^((?:\r?\n)*)((?:.*?|[\r\n]+[^\r\n])*?)((?:\r?\n)*)$/ ), | Work around a serializer crash exposed by rt tests
Change-Id: I<I>e5cd3d<I>cb<I>c6a4c<I>b<I> |
diff --git a/src/main/java/org/eobjects/datacleaner/widgets/table/DCTable.java b/src/main/java/org/eobjects/datacleaner/widgets/table/DCTable.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/eobjects/datacleaner/widgets/table/DCTable.java
+++ b/src/main/java/org/eobjects/datacleaner/widgets/table/DCTable.java
@@ -181,22 +181,27 @@ public class DCTable extends JXTable implements MouseListener {
return result;
}
+ @Override
public void mouseClicked(MouseEvent e) {
forwardMouseEvent(e);
}
+ @Override
public void mouseEntered(MouseEvent e) {
// forwardMouseEvent(e);
}
+ @Override
public void mouseExited(MouseEvent e) {
// forwardMouseEvent(e);
}
+ @Override
public void mousePressed(MouseEvent e) {
forwardMouseEvent(e);
}
+ @Override
public void mouseReleased(MouseEvent e) {
boolean forwarded = forwardMouseEvent(e);
if (!forwarded) { | Added @Override's to mouselistener methods on DCTable. |
diff --git a/lib/tower_cli/models/base.py b/lib/tower_cli/models/base.py
index <HASH>..<HASH> 100644
--- a/lib/tower_cli/models/base.py
+++ b/lib/tower_cli/models/base.py
@@ -210,7 +210,7 @@ class BaseResource(six.with_metaclass(ResourceMeta)):
code = six.get_function_code(method)
if 'pk' in code.co_varnames:
click.argument('pk', nargs=1, required=False,
- type=int)(cmd)
+ type=int, metavar='[ID]')(cmd)
# Done; return the command.
return cmd | Change [PK] in autodoc to [ID]. |
diff --git a/svc/server.go b/svc/server.go
index <HASH>..<HASH> 100644
--- a/svc/server.go
+++ b/svc/server.go
@@ -43,8 +43,8 @@ func NewServer(h http.Handler, opts ...NewServerOpt) *http.Server {
// RunServer handles the biolerplate of starting an http server and handling
// signals gracefully.
-func RunServer(srv *http.Server) {
- idleConnsClosed := make(chan struct{})
+func RunServer(srv *http.Server, shutdownFuncs ...func()) {
+ done := make(chan struct{})
go func() {
// Handle SIGINT and SIGTERM.
@@ -62,7 +62,12 @@ func RunServer(srv *http.Server) {
// Error from closing listeners, or context timeout:
fmt.Printf("HTTP server Shutdown: %v\n", err)
}
- close(idleConnsClosed)
+ // Run shutdown functions
+ for _, sf := range shutdownFuncs {
+ sf()
+ }
+
+ close(done)
}()
fmt.Printf("HTTP server listening on address: \"%s\"\n", srv.Addr)
@@ -72,5 +77,5 @@ func RunServer(srv *http.Server) {
os.Exit(1)
}
- <-idleConnsClosed
+ <-done
} | Add ability to pass shutdown functions to svc.RunServer |
diff --git a/controller/src/main/java/org/jboss/as/controller/ServiceVerificationHelper.java b/controller/src/main/java/org/jboss/as/controller/ServiceVerificationHelper.java
index <HASH>..<HASH> 100644
--- a/controller/src/main/java/org/jboss/as/controller/ServiceVerificationHelper.java
+++ b/controller/src/main/java/org/jboss/as/controller/ServiceVerificationHelper.java
@@ -166,9 +166,11 @@ class ServiceVerificationHelper extends AbstractServiceListener<Object> implemen
}
private static void reportImmediateDependants(List<String> problemList, ModelNode failureDescription) {
- ModelNode problemListNode = failureDescription.get(ControllerLogger.ROOT_LOGGER.servicesMissingDependencies());
- for (String problem: problemList) {
- problemListNode.add(problem);
+ if (!problemList.isEmpty()) {
+ ModelNode problemListNode = failureDescription.get(ControllerLogger.ROOT_LOGGER.servicesMissingDependencies());
+ for (String problem : problemList) {
+ problemListNode.add(problem);
+ }
}
} | [WFCORE-<I>]: Unneeded part of failure-description is printed in CLI for Elytron subsystem.
If the list is empty don't report it. |
diff --git a/tests/for-server/test-functionOps.js b/tests/for-server/test-functionOps.js
index <HASH>..<HASH> 100644
--- a/tests/for-server/test-functionOps.js
+++ b/tests/for-server/test-functionOps.js
@@ -9,7 +9,7 @@
import {assert, expect} from 'chai';
import {apply} from '../../src/function/apply';
import {call} from '../../src/function/call';
-import {flip, flipN, until} from '../../src/function/function';
+import {flip, flipN, until, id} from '../../src/function/function';
import {log, add, subtract, length, expectFalse, expectTrue, expectEqual, expectFunction} from './helpers';
// These variables get set at the top IIFE in the browser.
// ~~~ /STRIP ~~~
@@ -104,4 +104,14 @@ describe ('Function Operators', function () {
});
});
+ describe ('#id', function () {
+ it ('should be a function', function () {
+ expectFunction(id);
+ });
+ it ('should return whatever you give it', function () {
+ expectEqual(id(1), 1);
+ expectEqual(id(undefined), undefined);
+ });
+ });
+
}); | Added tests for 'id'. |
diff --git a/lib/utils/job-utils/ipmitool.js b/lib/utils/job-utils/ipmitool.js
index <HASH>..<HASH> 100755
--- a/lib/utils/job-utils/ipmitool.js
+++ b/lib/utils/job-utils/ipmitool.js
@@ -32,12 +32,15 @@ function ipmitoolFactory(Promise) {
" at /usr/bin/ipmitool");
return;
}
+
+ var options = { timeout: 60000 };
if (host && user && password && command) {
//var cmd = child_process.exec('/usr/bin/ipmitool -I
// lanplus -U '+user+' -H '+host+' -P '+password+" "+command
child_process.exec( // jshint ignore:line
'/usr/bin/ipmitool -U '+user+
' -H '+host+' -P '+password+" " + command,
+ options,
function(error, stdout, stderr) {
if (error) {
error.stderr = stderr;
@@ -49,6 +52,7 @@ function ipmitoolFactory(Promise) {
} else {
if (!host && command) {
child_process.exec('/usr/bin/ipmitool ' + command, // jshint ignore:line
+ options,
function(error, stdout, stderr) {
if (error) {
error.stderr = stderr; | Added timeout value for ipmitool child process |
diff --git a/salt/states/virtualenv.py b/salt/states/virtualenv.py
index <HASH>..<HASH> 100644
--- a/salt/states/virtualenv.py
+++ b/salt/states/virtualenv.py
@@ -7,7 +7,7 @@ import os
logger = logging.getLogger(__name__)
-def manage(name,
+def managed(name,
venv_bin='virtualenv',
requirements='',
no_site_packages=False,
@@ -133,3 +133,5 @@ def manage(name,
ret['result'] = True
return ret
+
+manage = managed | Rename virtualenv.manage to managed for consistency with file.managed |
diff --git a/upload/system/library/cache.php b/upload/system/library/cache.php
index <HASH>..<HASH> 100644
--- a/upload/system/library/cache.php
+++ b/upload/system/library/cache.php
@@ -33,7 +33,7 @@ class Cache {
fwrite($handle, serialize($value));
- close($handle);
+ fclose($handle);
}
public function delete($key) {
@@ -48,4 +48,4 @@ class Cache {
}
}
}
-?>
\ No newline at end of file
+?> | Update upload/system/library/cache.php
close($handle); changed to fclose($handle); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.