diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/spec/support/database_helper.rb b/spec/support/database_helper.rb index <HASH>..<HASH> 100644 --- a/spec/support/database_helper.rb +++ b/spec/support/database_helper.rb @@ -17,7 +17,7 @@ module DatabaseHelper require "sqlite3" end - path = Tempfile.new("baza_test").path + path = Tempfile.new(["baza_test", ".sqlite3"]).path File.unlink(path) if File.exists?(path) @db = Baza::Db.new(type: :sqlite3, path: path, index_append_table_name: true, debug: false) @@ -90,7 +90,7 @@ module DatabaseHelper @db.close path = db.args[:path] - File.unlink(path) + File.unlink(path) if File.exists?(path) Thread.current[:baza] = nil @db = nil end
Only remove file if test didn't already. Ensure correct extension on temp db
diff --git a/spec/unit/object_properties_spec.rb b/spec/unit/object_properties_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/object_properties_spec.rb +++ b/spec/unit/object_properties_spec.rb @@ -144,7 +144,7 @@ describe RestfulObjects::ObjectProperties do @object.bool_prop.should eq true @object.decimal_prop.should eq 333.33 @object.date_prop.should eq Date.new(2012, 2, 29) - @object.blob_prop.should eq "\xE5\xA5\xB4\x30\xF2\x8C\x71\xD9" + @object.blob_prop.should eq "\xE5\xA5\xB4\x30\xF2\x8C\x71\xD9".force_encoding('ASCII-8BIT') end it 'should process a property put with json' do
fixed test with encoding problem for ruby <I>
diff --git a/lib/sinon-doublist-fs/index.js b/lib/sinon-doublist-fs/index.js index <HASH>..<HASH> 100644 --- a/lib/sinon-doublist-fs/index.js +++ b/lib/sinon-doublist-fs/index.js @@ -45,6 +45,8 @@ function sinonDoublistFs(test) { nodeConsole = requireNative('codeactual-node-console').create(); log = nodeConsole.set('time', false).set('traceDepth', true).create(null, console.log); nodeConsole.traceMethods('FileStub', FileStub.prototype, log, null, /^(get|set)$/); + nodeConsole.traceMethods('customFsStub', customFsStub, log); + nodeConsole.traceMethods('mixin', mixin, log); } else { log = function() {}; }
fix(tracing): Wrap customFsStub, mixin methods
diff --git a/sark/code/function.py b/sark/code/function.py index <HASH>..<HASH> 100644 --- a/sark/code/function.py +++ b/sark/code/function.py @@ -84,6 +84,9 @@ class Function(object): raise ValueError("`None` is not a valid address. To use the current screen ea, " "use `Function(ea=Function.UseCurrentAddress)` or supply no `ea`.") + elif isinstance(ea, Line): + ea = ea.ea + self._func = get_func(ea) self._comments = Comments(self)
Function objects can now be created from line objects. Closes #<I>.
diff --git a/coconut/constants.py b/coconut/constants.py index <HASH>..<HASH> 100644 --- a/coconut/constants.py +++ b/coconut/constants.py @@ -115,7 +115,7 @@ all_reqs = { min_versions = { "pyparsing": (2, 2, 0), "cPyparsing": (2, 2, 0, 1, 1), - "pre-commit": (0, 15, 0), + "pre-commit": (0, 15, 2), "sphinx": (1, 6), "pygments": (2, 2), "recommonmark": (0, 4), @@ -140,7 +140,6 @@ version_strictly = [ "sphinx_bootstrap_theme", "ipython", "ipykernel", - "pre-commit", ] classifiers = [
Switch to new pre-commit version
diff --git a/dashbuilder-backend/dashbuilder-dataset-core/src/main/java/org/dashbuilder/dataprovider/StaticDataSetProvider.java b/dashbuilder-backend/dashbuilder-dataset-core/src/main/java/org/dashbuilder/dataprovider/StaticDataSetProvider.java index <HASH>..<HASH> 100644 --- a/dashbuilder-backend/dashbuilder-dataset-core/src/main/java/org/dashbuilder/dataprovider/StaticDataSetProvider.java +++ b/dashbuilder-backend/dashbuilder-dataset-core/src/main/java/org/dashbuilder/dataprovider/StaticDataSetProvider.java @@ -38,6 +38,9 @@ public class StaticDataSetProvider implements DataSetProvider { private SharedDataSetOpEngine dataSetOpEngine; + public StaticDataSetProvider() { + } + public StaticDataSetProvider(SharedDataSetOpEngine dataSetOpEngine) { this.dataSetOpEngine = dataSetOpEngine; }
Add missing non-args constructor (required by some CDI impls)
diff --git a/command/stack/deploy_bundlefile.go b/command/stack/deploy_bundlefile.go index <HASH>..<HASH> 100644 --- a/command/stack/deploy_bundlefile.go +++ b/command/stack/deploy_bundlefile.go @@ -54,7 +54,7 @@ func deployBundle(ctx context.Context, dockerCli *command.DockerCli, opts deploy for _, networkName := range service.Networks { nets = append(nets, swarm.NetworkAttachmentConfig{ Target: namespace.Scope(networkName), - Aliases: []string{networkName}, + Aliases: []string{internalName}, }) }
Set the alias to the service name instead of the network name This makes it work a little closer to compose part and it is more correct 👼
diff --git a/lib/ProMotion/screen/screen_module.rb b/lib/ProMotion/screen/screen_module.rb index <HASH>..<HASH> 100644 --- a/lib/ProMotion/screen/screen_module.rb +++ b/lib/ProMotion/screen/screen_module.rb @@ -5,7 +5,7 @@ module ProMotion include ProMotion::Styling include ProMotion::NavBarModule include ProMotion::Tabs - include ProMotion::SplitScreen if UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad + include ProMotion::SplitScreen if UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad || (UIDevice.currentDevice.systemVersion.to_i >= 8 ) attr_accessor :parent_screen, :first_screen, :modal, :split_screen
Fixed another location where `ProMotion::SplitScreen` should be included on iPhones with iOS 8.
diff --git a/asciimatics/widgets/layout.py b/asciimatics/widgets/layout.py index <HASH>..<HASH> 100644 --- a/asciimatics/widgets/layout.py +++ b/asciimatics/widgets/layout.py @@ -108,6 +108,8 @@ class Layout(object): if widget.name in self._frame.data: widget.value = self._frame.data[widget.name] + return widget + def clear_widgets(self): """ Clear all widgets from this Layout.
Add "return widget" to Layout's add_widget() method to make chaining easier
diff --git a/platform/nativescript/backend.js b/platform/nativescript/backend.js index <HASH>..<HASH> 100644 --- a/platform/nativescript/backend.js +++ b/platform/nativescript/backend.js @@ -97,6 +97,10 @@ exports.init = function(ctx) { page = nativeContext ctx.element = new Element(ctx, parentLayout) + + log('page size: ', page.getMeasuredWidth(), 'x', page.getMeasuredHeight()) + context.width = page.getMeasuredWidth() + context.height = page.getMeasuredHeight() } @@ -105,9 +109,6 @@ exports.run = function(ctx, callback) { } exports.finalize = function() { - log('page size: ', page.getMeasuredWidth(), 'x', page.getMeasuredHeight()) - context.width = page.getMeasuredWidth() - context.height = page.getMeasuredHeight() finalization_callback() finalization_callback = null }
moved page initialisation stuff into .init() again
diff --git a/internal/qtls/go117.go b/internal/qtls/go117.go index <HASH>..<HASH> 100644 --- a/internal/qtls/go117.go +++ b/internal/qtls/go117.go @@ -93,7 +93,7 @@ type cipherSuiteTLS13 struct { Hash crypto.Hash } -//go:linkname cipherSuiteTLS13ByID github.com/marten-seemann/qtls-go1-16.cipherSuiteTLS13ByID +//go:linkname cipherSuiteTLS13ByID github.com/marten-seemann/qtls-go1-17.cipherSuiteTLS13ByID func cipherSuiteTLS13ByID(id uint16) *cipherSuiteTLS13 // CipherSuiteTLS13ByID gets a TLS 1.3 cipher suite.
fix relocation target for cipherSuiteTLS<I>ByID in Go <I>
diff --git a/server.js b/server.js index <HASH>..<HASH> 100644 --- a/server.js +++ b/server.js @@ -36,9 +36,6 @@ function Server (opts) { EventEmitter.call(self) opts = opts || {} - if (opts.http === false && opts.udp === false) - throw new Error('must start at least one type of server (http or udp)') - self._intervalMs = opts.interval ? opts.interval : 10 * 60 * 1000 // 10 min
server: rm check for http/udp option my use-case brings its own http server, i just use onHttpRequest()
diff --git a/src/SupervisorOptions.php b/src/SupervisorOptions.php index <HASH>..<HASH> 100644 --- a/src/SupervisorOptions.php +++ b/src/SupervisorOptions.php @@ -137,7 +137,6 @@ class SupervisorOptions */ public $force; - /** * Create a new worker options instance. *
Apply fixes from StyleCI (#<I>)
diff --git a/lib/utils.js b/lib/utils.js index <HASH>..<HASH> 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -157,7 +157,7 @@ DomUtils.removeElement = function(elem){ if(elem.next) elem.next.prev = elem.prev; if(elem.parent){ - elem.parent.children.splice(elem.parent.children.indexOf(elem), 1); + elem.parent.children.splice(elem.parent.children.lastIndexOf(elem), 1); } };
call Array#lastIndexOf in .removeElement leads to a speedup in `cornet` and doesn't hurt performance elsewhere
diff --git a/openquake/risklib/riskmodels.py b/openquake/risklib/riskmodels.py index <HASH>..<HASH> 100644 --- a/openquake/risklib/riskmodels.py +++ b/openquake/risklib/riskmodels.py @@ -331,7 +331,7 @@ class RiskModel(object): for i, asset in enumerate(assets)] return list(zip(eal_original, eal_retrofitted, bcr_results)) - def scenario_risk(self, loss_type, assets, gmvs, eids, epsilons): + def event_based_risk(self, loss_type, assets, gmvs, eids, epsilons): """ :returns: an array of shape (A, E) """ @@ -355,7 +355,7 @@ class RiskModel(object): loss_matrix[:, :] = (loss_ratio_matrix.T * values).T return loss_matrix - scenario = ebrisk = event_based_risk = scenario_risk + scenario = ebrisk = scenario_risk = event_based_risk def scenario_damage(self, loss_type, assets, gmvs, eids=None, eps=None): """
Renamed scenario_risk -> event_based_risk in the RiskModel
diff --git a/lib/chef/provider/package.rb b/lib/chef/provider/package.rb index <HASH>..<HASH> 100644 --- a/lib/chef/provider/package.rb +++ b/lib/chef/provider/package.rb @@ -25,8 +25,6 @@ require 'chef/platform' class Chef class Provider class Package < Chef::Provider - provides :package - include Chef::Mixin::Command include Chef::Mixin::ShellOut diff --git a/lib/chef/provider/service.rb b/lib/chef/provider/service.rb index <HASH>..<HASH> 100644 --- a/lib/chef/provider/service.rb +++ b/lib/chef/provider/service.rb @@ -23,8 +23,6 @@ class Chef class Provider class Service < Chef::Provider - provides :service - include Chef::Mixin::Command def initialize(new_resource, run_context)
Remove generic provides :package and provides :service from base classes
diff --git a/php/commands/plugin.php b/php/commands/plugin.php index <HASH>..<HASH> 100644 --- a/php/commands/plugin.php +++ b/php/commands/plugin.php @@ -568,9 +568,16 @@ class Plugin_Command extends \WP_CLI\CommandWithUpgrade { if ( '.' == $plugin_dir ) $plugin_dir = $plugin->file; - $command = 'rm -rf ' . path_join( WP_PLUGIN_DIR, $plugin_dir ); + $path = path_join( WP_PLUGIN_DIR, $plugin_dir ); - return ! WP_CLI::launch( $command ); + if ( \WP_CLI\Utils\is_windows() ) { + $command = 'rd /s /q '; + $path = str_replace( "/", "\\", $path ); + } else { + $command = 'rm -rf '; + } + + return ! WP_CLI::launch( $command . $path ); } }
Fix wp plugin delete on Windows
diff --git a/embeddedassets/services/EmbeddedAssetsService.php b/embeddedassets/services/EmbeddedAssetsService.php index <HASH>..<HASH> 100644 --- a/embeddedassets/services/EmbeddedAssetsService.php +++ b/embeddedassets/services/EmbeddedAssetsService.php @@ -35,6 +35,8 @@ class EmbeddedAssetsService extends BaseApplicationComponent public function __construct() { + require_once Craft::getPathOfAlias('system.vendors.htmlpurifier') . '/HTMLPurifier.standalone.php'; + $whitelist = EmbeddedAssetsPlugin::getWhitelist(); foreach($whitelist as $i => $url)
#9 Fixed fatal issue with non-ASCII characters in entry slugs
diff --git a/source/php/BulkImport.php b/source/php/BulkImport.php index <HASH>..<HASH> 100644 --- a/source/php/BulkImport.php +++ b/source/php/BulkImport.php @@ -164,7 +164,13 @@ class BulkImport //Sanity check, many users to remove? $maxDeleteLimit = (int) isset($_GET['maxDeletelimit']) ? $_GET['maxDeletelimit'] : 20; if (count($deleteAccounts) > $maxDeleteLimit) { - wp_mail(get_option('admin_email'), "Ad-integration plugin", "To many user deletions in queue (" . $maxDeleteLimit . ") add &maxDeleteLimit=number to your query to allow number of required deletions."); + if (is_main_site()) { + wp_mail( + get_option('admin_email'), + "Ad-integration plugin", + __("To many user deletions in queue (" . count($deleteAccounts) . "/" . $maxDeleteLimit . ") add https://test.dev/wp-admin/?adbulkimport&maxDeleteLimit=100 to your query to allow number of required deletions.", "adintegration") + ); + } } else { //Step 2: Delete these accounts if (is_array($deleteAccounts) && !empty($deleteAccounts)) {
Only send email on first blog. Better mail details too.
diff --git a/autolens/model/profiles/mass_profiles.py b/autolens/model/profiles/mass_profiles.py index <HASH>..<HASH> 100644 --- a/autolens/model/profiles/mass_profiles.py +++ b/autolens/model/profiles/mass_profiles.py @@ -702,7 +702,7 @@ class AbstractEllipticalGeneralizedNFW(EllipticalMassProfile, MassProfile): delta_concentration = self.delta_concentration( critical_surface_mass_density_arcsec=critical_surface_mass_density_arcsec, cosmic_average_mass_density_arcsec=cosmic_average_mass_density_arcsec) - return fsolve(func=self.concentration_func, x0=10.0, args=(delta_concentration,)) + return fsolve(func=self.concentration_func, x0=10.0, args=(delta_concentration,))[0] def concentration_func(self, concentration, delta_concentration): return 200.0 / 3.0 * (concentration * concentration * concentration / @@ -994,6 +994,7 @@ class SphericalTruncatedNFWChallenge(SphericalTruncatedNFW): super(SphericalTruncatedNFWChallenge, self).__init__(centre=centre, kappa_s=kappa_s, scale_radius=scale_radius, truncation_radius=truncation_radius) + class EllipticalNFW(AbstractEllipticalGeneralizedNFW): def __init__(self, centre=(0.0, 0.0), axis_ratio=1.0, phi=0.0, kappa_s=0.05, scale_radius=5.0):
Fixed visualization bug where plotting a mask leads the image to have white buffer surrounding it.
diff --git a/mythril/analysis/solver.py b/mythril/analysis/solver.py index <HASH>..<HASH> 100644 --- a/mythril/analysis/solver.py +++ b/mythril/analysis/solver.py @@ -103,7 +103,7 @@ def get_transaction_sequence(global_state, constraints): concrete_transactions[tx_id]["calldata"] = "0x" + "".join( [ hex(b)[2:] if len(hex(b)) % 2 == 0 else "0" + hex(b)[2:] - for b in transaction.call_data.concretized(model) + for b in transaction.call_data.concrete(model) ] )
mythril/analysis/solver: Refactor to support changes in calldata
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -22,7 +22,11 @@ let AlexandriaCore = (function(){ config: { Addresses: { Swarm: [ - '/ip4/163.172.37.165/tcp/4001/ipfs/QmRvfRjoCCwVLbVAiYWqJJCiQKqGqSuKckv4eDKEHZXxZu' + '/ip4/163.172.37.165/tcp/4001/ipfs/QmRvfRjoCCwVLbVAiYWqJJCiQKqGqSuKckv4eDKEHZXxZu', + "/ip4/69.172.212.23/tcp/4001/ipfs/QmXUcnxbsDkazGNvgf1kQya6YwVqNsLbVhzg3LHNTteqwz", + "/ip4/69.172.212.23/tcp/4002/ws/ipfs/QmXUcnxbsDkazGNvgf1kQya6YwVqNsLbVhzg3LHNTteqwz", + "/ip4/192.99.6.117/tcp/4001/ipfs/QmQ85u4dH4EPRpNxLxBMvUCHCUyuyZgBZsfW81rzh51FtY", + "/ip6/2607:5300:60:3775::/tcp/4001/ipfs/QmQ85u4dH4EPRpNxLxBMvUCHCUyuyZgBZsfW81rzh51FtY" ] } }
Add more Swarm servers to IPFS
diff --git a/bigchaindb/version.py b/bigchaindb/version.py index <HASH>..<HASH> 100644 --- a/bigchaindb/version.py +++ b/bigchaindb/version.py @@ -1,2 +1,2 @@ -__version__ = '0.5.1' -__short_version__ = '0.5' +__version__ = '0.6.0' +__short_version__ = '0.6'
Bumped the version number to <I> in version.py
diff --git a/java/server/test/org/openqa/selenium/grid/node/config/NodeOptionsTest.java b/java/server/test/org/openqa/selenium/grid/node/config/NodeOptionsTest.java index <HASH>..<HASH> 100644 --- a/java/server/test/org/openqa/selenium/grid/node/config/NodeOptionsTest.java +++ b/java/server/test/org/openqa/selenium/grid/node/config/NodeOptionsTest.java @@ -74,9 +74,7 @@ public class NodeOptionsTest { @Test public void canConfigureNodeWithDriverDetection() { assumeFalse("We don't have driver servers in PATH when we run unit tests", - Boolean.getBoolean("TRAVIS")); - System.out.println("Wonder why assumeFalse did not work, TRAVIS = " + Boolean.getBoolean("TRAVIS")); - System.getenv().forEach((k, v) -> System.out.println(String.format("%s=%s", k, v))); + Boolean.parseBoolean(System.getenv("TRAVIS"))); Config config = new MapConfig(ImmutableMap.of( "node", ImmutableMap.of("detect-drivers", "true")));
[java] Oh, I've mixed up system properties with env variables...
diff --git a/src/module/Tree.js b/src/module/Tree.js index <HASH>..<HASH> 100644 --- a/src/module/Tree.js +++ b/src/module/Tree.js @@ -109,10 +109,6 @@ class Tree extends Component { this.setCollapsible = this.setCollapsible.bind(this); this.populateData = this.populateData.bind(this); this.populateError = this.populateError.bind(this); - - if (this.props.tree) { - this.props.tree.root = translateSpans(assignNodeIds(this.props.tree.root)); - } } componentDidMount() { @@ -241,6 +237,9 @@ class Tree extends Component { this.fetchData(fetchPath, "get", {}, false); } else { // Load static data + if (this.props.tree) { + this.props.tree.root = translateSpans(assignNodeIds(this.props.tree.root)); + } const { fetchedData, selectedData } = this.sanitizeResponse(this.props.tree, false); this.populateData(fetchedData, "", selectedData); }
Translate the tree one very property change. This makes it possible to re-render the tree without remounting the component, which is required for embedding the application in a react application.
diff --git a/subliminal/services/bierdopje.py b/subliminal/services/bierdopje.py index <HASH>..<HASH> 100644 --- a/subliminal/services/bierdopje.py +++ b/subliminal/services/bierdopje.py @@ -19,7 +19,7 @@ from . import ServiceBase from ..cache import cachedmethod from ..exceptions import ServiceError from ..language import language_set -from ..subtitles import get_subtitle_path, ResultSubtitle +from ..subtitles import get_subtitle_path, ResultSubtitle, EXTENSIONS from ..utils import to_unicode from ..videos import Episode from bs4 import BeautifulSoup @@ -87,8 +87,11 @@ class BierDopje(ServiceBase): continue path = get_subtitle_path(filepath, language, self.config.multi) for result in soup.results('result'): + release = to_unicode(result.filename.contents[0]) + if not release.endswith(tuple(EXTENSIONS)): + release += '.srt' subtitle = ResultSubtitle(path, language, self.__class__.__name__.lower(), result.downloadlink.contents[0], - release=to_unicode(result.filename.contents[0])) + release=release) subtitles.append(subtitle) return subtitles
Fix subtitle release name in BierDopje Matching confidence could not be computed because of the missing extension
diff --git a/ReText/window.py b/ReText/window.py index <HASH>..<HASH> 100644 --- a/ReText/window.py +++ b/ReText/window.py @@ -261,9 +261,9 @@ class ReTextWindow(QMainWindow): self.symbolBox.activated.connect(self.insertSymbol) self.updateStyleSheet() menubar = self.menuBar() - menuFile = menubar.addMenu(self.tr('File')) - menuEdit = menubar.addMenu(self.tr('Edit')) - menuHelp = menubar.addMenu(self.tr('Help')) + menuFile = menubar.addMenu(self.tr('&File')) + menuEdit = menubar.addMenu(self.tr('&Edit')) + menuHelp = menubar.addMenu(self.tr('&Help')) menuFile.addAction(self.actionNew) menuFile.addAction(self.actionOpen) self.menuRecentFiles = menuFile.addMenu(self.tr('Open recent'))
Underline character mnemonics. In order to indicate keyboard shortcuts for items in the menu bar.
diff --git a/spec/unit/compiler/text_processor_spec.rb b/spec/unit/compiler/text_processor_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/compiler/text_processor_spec.rb +++ b/spec/unit/compiler/text_processor_spec.rb @@ -234,6 +234,20 @@ module Epuber XHTMLProcessor.resolved_link_to_file('', nil, 'root.txt', finder) }.to raise_error FileFinders::FileNotFoundError end + + it 'will not raise for valid path' do + FileUtils.mkdir_p('image') + FileUtils.touch('image/stan_mindsetbw.png') + + FileUtils.mkdir_p('text') + FileUtils.touch('text/root.txt') + + finder = FileFinders::Normal.new('/') + + expect { + XHTMLProcessor.resolved_link_to_file('image/stan_mindsetbw.png', nil, 'text/root.txt', finder) + }.to_not raise_error + end end context '.resolve_links_for' do
[Spec] add one test to text_processor_spec
diff --git a/Log/Logger.php b/Log/Logger.php index <HASH>..<HASH> 100644 --- a/Log/Logger.php +++ b/Log/Logger.php @@ -36,11 +36,11 @@ class Logger implements LoggerInterface $logMessage->setLevel($level); if ($context) { - if (isset($context['request'])) { + if (!empty($context['request'])) { $logMessage->setRequest(new LogRequest($context['request'])); } - if (isset($context['response'])) { + if (!empty($context['response'])) { $logMessage->setResponse(new LogResponse($context['response'])); } }
Check context response/request existence before logging it (#<I>)
diff --git a/src/Signature.php b/src/Signature.php index <HASH>..<HASH> 100644 --- a/src/Signature.php +++ b/src/Signature.php @@ -268,7 +268,12 @@ final class Signature * A signature is valid if r is congruent to x1 (mod n) * or in other words, if r - x1 is an integer multiple of n. */ - return (bool)($this->Compare($r, $Z['x']) == 0); + if ($this->Compare($r, $Z['x']) == 0) { + return true; + } else { + throw new \Exception('The signature is invalid! Value used for $r was "' . var_export($r, true) . '" and the calculated $x parameter was "' . var_export($Z['x'], true) . '".'); + } + } catch (\Exception $e) { throw $e; }
Added exception to Verify() function
diff --git a/lib/resources/setup.js b/lib/resources/setup.js index <HASH>..<HASH> 100644 --- a/lib/resources/setup.js +++ b/lib/resources/setup.js @@ -55,7 +55,7 @@ function tableCreation(req, res, next) { oncomplete: function(err) { if(err) return next(err); - res.end(); + res.end('data: ' + JSON.stringify({done: true}) + '\n\n'); }, onprogress: function(script) {
Send done message when all tables are created
diff --git a/common/src/main/java/tachyon/security/authentication/AuthenticationUtils.java b/common/src/main/java/tachyon/security/authentication/AuthenticationUtils.java index <HASH>..<HASH> 100644 --- a/common/src/main/java/tachyon/security/authentication/AuthenticationUtils.java +++ b/common/src/main/java/tachyon/security/authentication/AuthenticationUtils.java @@ -102,7 +102,9 @@ public final class AuthenticationUtils { * @return An unconnected socket */ public static TSocket createTSocket(InetSocketAddress address) { - return new TSocket(NetworkAddressUtils.getFqdnHost(address), address.getPort()); + // TODO: make the timeout configurable. + return new TSocket(NetworkAddressUtils.getFqdnHost(address), address.getPort(), + 30 * Constants.SECOND_MS); } private AuthenticationUtils() {} // prevent instantiation
Use timeout for thrift RPCs
diff --git a/src/graph/Plot.java b/src/graph/Plot.java index <HASH>..<HASH> 100644 --- a/src/graph/Plot.java +++ b/src/graph/Plot.java @@ -199,7 +199,7 @@ public final class Plot { final PrintWriter datafile = new PrintWriter(datafiles[i]); try { for (final DataPoint d : datapoints.get(i)) { - final long ts = d.timestamp(); + final long ts = d.timestamp() / 1000; if (ts >= (start_time & UNSIGNED) && ts <= (end_time & UNSIGNED)) { npoints++; }
Modify Plot to convert the ms timestamps back to seconds
diff --git a/handler.go b/handler.go index <HASH>..<HASH> 100644 --- a/handler.go +++ b/handler.go @@ -47,7 +47,7 @@ func HandlerLoggerRouter(fn Handler) httprouter.Handle { } func handlerLogger(fn Handler, w http.ResponseWriter, r *http.Request, p httprouter.Params) { - l := newHandlerLogEntry(r) + l := NewHandlerLogEntry(r) l.Info("New request") starttime := time.Now() @@ -90,7 +90,7 @@ func handlerError(w http.ResponseWriter, r *http.Request, e *HandlerError) { http.Error(w, scode+" - "+e.Error.Error(), e.Code) } -func newHandlerLogEntry(r *http.Request) *log.Entry { +func NewHandlerLogEntry(r *http.Request) *log.Entry { remote, _, err := net.SplitHostPort(r.RemoteAddr) if err != nil { log.WithFields(log.Fields{
Exported NewHandlerLogEntry.
diff --git a/lib/danger/danger_core/dangerfile.rb b/lib/danger/danger_core/dangerfile.rb index <HASH>..<HASH> 100644 --- a/lib/danger/danger_core/dangerfile.rb +++ b/lib/danger/danger_core/dangerfile.rb @@ -250,7 +250,7 @@ module Danger danger_id: danger_id } - if env.request_source.respond_to?(:update_pr_by_line!) + if env.request_source.respond_to?(:update_pr_by_line!) && ENV["DANGER_MESSAGE_AGGREGATION"] env.request_source.update_pr_by_line!(messages: MessageAggregator.aggregate(**report)) else env.request_source.update_pull_request!(
Prevent message aggregation unless DANGER_MESSAGE_AGGREGATION environment variable is set
diff --git a/pydbus/bus.py b/pydbus/bus.py index <HASH>..<HASH> 100644 --- a/pydbus/bus.py +++ b/pydbus/bus.py @@ -53,15 +53,6 @@ class Bus(OwnMixin, WatchMixin): return self def __exit__(self, exc_type, exc_value, traceback): - if self.con: - self.close() - - def __del__(self): - if self.con: - self.close() - - def close(self): - self.con.close_sync(None) self.con = None def SystemBus(): diff --git a/pydbus/tests/context.py b/pydbus/tests/context.py index <HASH>..<HASH> 100644 --- a/pydbus/tests/context.py +++ b/pydbus/tests/context.py @@ -5,3 +5,9 @@ with SessionBus() as bus: assert(notifications.Notify) assert(bus.con is None) + +with SessionBus() as bus: + notifications = bus.get('.Notifications') + assert(notifications.Notify) + +assert(bus.con is None)
Drop bus.close(), as it does an unexpected thing. In __init__ we obtain a reference to a singleton object, and do not create it. Therefore we shouldn't close it on exit.
diff --git a/features/eolearn/features/interpolation.py b/features/eolearn/features/interpolation.py index <HASH>..<HASH> 100644 --- a/features/eolearn/features/interpolation.py +++ b/features/eolearn/features/interpolation.py @@ -128,7 +128,8 @@ class InterpolationTask(EOTask): if self.feature_name not in eopatch.data: raise ValueError('Feature {} not found in EOPatch.data.'.format(self.feature_name)) - feature_data = eopatch.data[self.feature_name] + # Make a copy not to change original numpy array + feature_data = eopatch.data[self.feature_name].copy() time_num, height, width, band_num = eopatch.data[self.feature_name].shape # Prepare mask of valid data @@ -149,6 +150,10 @@ class InterpolationTask(EOTask): total_diff = int((new_eopatch.timestamp[0].date() - start_time.date()).total_seconds()) resampled_times = new_eopatch.time_series() + total_diff + # Add BBox to eopatch if it was created anew + if new_eopatch.bbox is None: + new_eopatch.bbox = eopatch.bbox + # Interpolate feature_data = self.interpolate_data(feature_data, times, resampled_times)
minor fixes * copy data array when setting invalid data to nans * adding bbox to newly created eopatch
diff --git a/tests/GeometryTest.php b/tests/GeometryTest.php index <HASH>..<HASH> 100644 --- a/tests/GeometryTest.php +++ b/tests/GeometryTest.php @@ -319,7 +319,7 @@ class GeometryTest extends AbstractTestCase * @param string $geometry The WKT of the geometry to test. * @param string $envelope The WKT of the expected envelope. */ - public function envelope($geometry, $envelope) + public function testEnvelope($geometry, $envelope) { $this->assertSame($envelope, Geometry::fromText($geometry)->envelope()->asText()); }
Fix test not running due to incorrect method name
diff --git a/lib/ruby-lint/definitions/core/env.rb b/lib/ruby-lint/definitions/core/env.rb index <HASH>..<HASH> 100644 --- a/lib/ruby-lint/definitions/core/env.rb +++ b/lib/ruby-lint/definitions/core/env.rb @@ -4,6 +4,7 @@ # Platform: rbx 2.0.0.rc1 # RubyLint::GlobalScope.definitions.define_constant('ENV') do |klass| + klass.inherits(RubyLint::GlobalScope.constant_proxy('Hash')) end -RubyLint::GlobalScope.definitions.lookup(:const, 'ENV').deep_freeze \ No newline at end of file +RubyLint::GlobalScope.definitions.lookup(:const, 'ENV').deep_freeze
ENV should inherit from Hash. Although technically not true the class of ENV is "undefined" between Ruby implementations. Since it behaves like a Hash this the closest and easiest solution.
diff --git a/example/rcnn/rcnn/dataset/pascal_voc_eval.py b/example/rcnn/rcnn/dataset/pascal_voc_eval.py index <HASH>..<HASH> 100644 --- a/example/rcnn/rcnn/dataset/pascal_voc_eval.py +++ b/example/rcnn/rcnn/dataset/pascal_voc_eval.py @@ -48,8 +48,8 @@ def voc_ap(rec, prec, use_07_metric=False): ap += p / 11. else: # append sentinel values at both ends - mrec = np.concatenate([0.], rec, [1.]) - mpre = np.concatenate([0.], prec, [0.]) + mrec = np.concatenate(([0.], rec, [1.])) + mpre = np.concatenate(([0.], prec, [0.])) # compute precision integration ladder for i in range(mpre.size - 1, 0, -1):
Fix voc_ap issue in rcnn test path. (#<I>) * Fixes mxnet additonal deps: python-matplotlib is an apt package, not a pip package, and the pip package for scimage is scikit-image * Fixes issue in voc_ap where np.concatenate expects a tuple.
diff --git a/src/frontend/org/voltdb/dbmonitor/js/voltdb.sqlquery.ui.js b/src/frontend/org/voltdb/dbmonitor/js/voltdb.sqlquery.ui.js index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/dbmonitor/js/voltdb.sqlquery.ui.js +++ b/src/frontend/org/voltdb/dbmonitor/js/voltdb.sqlquery.ui.js @@ -1,5 +1,13 @@ $(document).ready(function () { - + if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) { + shortcut.add("f6", function () { + $("#runBTn").button().click(); + }); + } else { + shortcut.add("f5", function () { + $("#runBTn").button().click(); + }); + } //Default Action $(".tab_content").hide(); //Hide all content $("ul.tabs li:first").addClass("active").show(); //Activate first tab @@ -224,6 +232,4 @@ function loadPage(serverName, portid) { $('#clearQuery').click(function () { $('#theQueryText').val(''); }); - - shortcut.add("F5", function () { $("#runBTn").button().click(); }); }
Modified code to use 'F6' key to execute query in studio in case of Safari browser.
diff --git a/qingstor/sdk/unpack.py b/qingstor/sdk/unpack.py index <HASH>..<HASH> 100644 --- a/qingstor/sdk/unpack.py +++ b/qingstor/sdk/unpack.py @@ -51,7 +51,7 @@ class Unpacker(dict): # In other situations, body should not be unpacked for possibly large memory usage if not ( self.res.ok and - self.res.headers["Content-Type"] != "application/json" + self.res.headers.get("Content-Type") != "application/json" ): try: data = self.res.json()
Fix key error while delete not return content-type
diff --git a/addon/utils/first-load-offline-objects.js b/addon/utils/first-load-offline-objects.js index <HASH>..<HASH> 100644 --- a/addon/utils/first-load-offline-objects.js +++ b/addon/utils/first-load-offline-objects.js @@ -57,7 +57,9 @@ export function firstLoadOfflineObjects(dexieDB, odataPath, functionName, modelN } }); - dexieDB.table(modelName).bulkAdd(objArray).then(() => resolve(), () => reject()); + dexieDB.table(modelName).bulkPut(objArray).then(() => resolve(), () => reject()); + }).fail(function() { + return reject(modelName); }); }); }
Add rejected model to firstLoadOfflineObjects function
diff --git a/stream.js b/stream.js index <HASH>..<HASH> 100644 --- a/stream.js +++ b/stream.js @@ -35,6 +35,8 @@ Stream.prototype._ready = function () { else this.cursor = ltgt.lowerBound(this.opts, 0) + if(this.cursor < 0) this.cursor = 0 + var self = this this.blocks.getBlock(~~(this.cursor/self.blocks.block), function (err, buffer) { self._buffer = buffer @@ -153,3 +155,8 @@ Stream.prototype.abort = function (err) { Stream.prototype.pipe = require('push-stream/pipe') + + + + +
accept -1 as a lower bound, compat with flumelog
diff --git a/lib/celluloid/zmq.rb b/lib/celluloid/zmq.rb index <HASH>..<HASH> 100644 --- a/lib/celluloid/zmq.rb +++ b/lib/celluloid/zmq.rb @@ -6,6 +6,8 @@ require 'celluloid/zmq/reactor' module Celluloid # Actors which run alongside 0MQ operations + # This is a temporary hack (hopefully) until ffi-rzmq exposes IO objects for + # 0MQ sockets that can be used with Celluloid::IO module ZMQ def self.included(klass) klass.send :include, ::Celluloid
A note on Celluloid::ZMQ's hopefully ephemeral nature
diff --git a/keyring/backend.py b/keyring/backend.py index <HASH>..<HASH> 100644 --- a/keyring/backend.py +++ b/keyring/backend.py @@ -232,9 +232,9 @@ class SchemeSelectable: KeypassXC=dict(username='UserName', service='Title'), ) - def _query(self, service, username): + def _query(self, service, username=None, **base): scheme = self.schemes[self.scheme] - return ( + return dict( { scheme['username']: username, scheme['service']: service, @@ -242,5 +242,6 @@ class SchemeSelectable: if username else { scheme['service']: service, - } + }, + **base, ) diff --git a/keyring/backends/SecretService.py b/keyring/backends/SecretService.py index <HASH>..<HASH> 100644 --- a/keyring/backends/SecretService.py +++ b/keyring/backends/SecretService.py @@ -86,10 +86,7 @@ class Keyring(backend.SchemeSelectable, KeyringBackend): def set_password(self, service, username, password): """Set password for the username of the service""" collection = self.get_preferred_collection() - attributes = dict( - self._query(service, username), - application=self.appid, - ) + attributes = self._query(service, username, application=self.appid) label = "Password for '{}' on '{}'".format(username, service) with closing(collection.connection): collection.create_item(label, attributes, password, replace=True)
Allow _query to include other keys
diff --git a/sprd/model/Order.js b/sprd/model/Order.js index <HASH>..<HASH> 100644 --- a/sprd/model/Order.js +++ b/sprd/model/Order.js @@ -20,7 +20,11 @@ define(["sprd/data/SprdModel", "sprd/model/Shop", "sprd/model/OrderItem", "js/da billing: Delivery.Billing, shipping: Shipping, repayable: Boolean, - priceTotal: Price + priceTotal: Price, + user: { + type: Object, + required: false + } }, totalItemsCount: function() {
DEV-<I> - added user into Order model
diff --git a/src/js/ripple/remote.js b/src/js/ripple/remote.js index <HASH>..<HASH> 100644 --- a/src/js/ripple/remote.js +++ b/src/js/ripple/remote.js @@ -2036,7 +2036,7 @@ Remote.prepareCurrencies = function(currency) { } if (currency.hasOwnProperty('currency')) { - newCurrency.currency = Currency.json_rewrite(currency.currency); + newCurrency.currency = Currency.json_rewrite(currency.currency, {force_hex:true}); } return newCurrency;
[FIX] Cannot use demmurage currencies in path_find Use hex format instead of json for currencies.
diff --git a/packages/react-bootstrap-table2/src/bootstrap-table.js b/packages/react-bootstrap-table2/src/bootstrap-table.js index <HASH>..<HASH> 100644 --- a/packages/react-bootstrap-table2/src/bootstrap-table.js +++ b/packages/react-bootstrap-table2/src/bootstrap-table.js @@ -170,7 +170,7 @@ BootstrapTable.propTypes = { }), onRowExpand: PropTypes.func, onAllRowExpand: PropTypes.func, - isAnyExpands: PropTypes.func, + isAnyExpands: PropTypes.bool, rowStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.func]), rowEvents: PropTypes.object, rowClasses: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
fix Warning: Failed prop type: Invalid prop of type supplied to , expected
diff --git a/addon/models/user.js b/addon/models/user.js index <HASH>..<HASH> 100644 --- a/addon/models/user.js +++ b/addon/models/user.js @@ -3,10 +3,10 @@ import DS from 'ember-data'; import OsfModel from 'ember-osf/models/base'; export default OsfModel.extend({ - full_name: DS.attr('string'), - given_name: DS.attr('string'), - middle_names: DS.attr(), - family_name: DS.attr('string'), + fullName: DS.attr('string'), + givenName: DS.attr('string'), + middleNames: DS.attr(), + familyName: DS.attr('string'), nodes: DS.hasMany('nodes') });
CamelCase user model fields
diff --git a/python/ccxt/async_support/base/exchange.py b/python/ccxt/async_support/base/exchange.py index <HASH>..<HASH> 100644 --- a/python/ccxt/async_support/base/exchange.py +++ b/python/ccxt/async_support/base/exchange.py @@ -74,12 +74,8 @@ class Exchange(BaseExchange): def open(self): if self.own_session and self.session is None: - context = None - if self.verify: - # Create our SSL context object with our CA cert file - context = ssl.create_default_context(cafile=self.cafile) - else: - context = self.verify + # Create our SSL context object with our CA cert file + context = ssl.create_default_context(cafile=self.cafile) if self.verify else self.verify # Pass this SSL context to aiohttp and create a TCPConnector connector = aiohttp.TCPConnector(ssl=context, loop=self.asyncio_loop) self.session = aiohttp.ClientSession(loop=self.asyncio_loop, connector=connector, trust_env=self.aiohttp_trust_env)
async_support/base/exchange.py minor simplifications #<I>
diff --git a/pyramid_webassets/tests/test_webassets.py b/pyramid_webassets/tests/test_webassets.py index <HASH>..<HASH> 100644 --- a/pyramid_webassets/tests/test_webassets.py +++ b/pyramid_webassets/tests/test_webassets.py @@ -776,7 +776,13 @@ class TestBaseUrlBehavior(object): # Work a bit the resolve output (o.css will activate the output=o.css) ('mypkg:static', 'manual', 'mypkg:static/t.css', - 'http://example.com/static/o.css')], + 'http://example.com/static/o.css'), + + # Test the string joins when using a package root as the asset spec + # The expected output is relative until/unless Pyramid merges + # https://github.com/Pylons/pyramid/pull/1377 + # As such, this is not really a recommended setup. + ('mypkg:', 'automatic', 'mypkg:static/t.css', '/static/o.css')], ) def test_url(self, base_dir, static_view, webasset, expected): """
Test package root asset spec base directory
diff --git a/taskcluster/aio/asyncclient.py b/taskcluster/aio/asyncclient.py index <HASH>..<HASH> 100644 --- a/taskcluster/aio/asyncclient.py +++ b/taskcluster/aio/asyncclient.py @@ -221,7 +221,7 @@ class AsyncBaseClient(BaseClient): try: await response.release() return await response.json() - except ValueError: + except (ValueError, aiohttp.client_exceptions.ContentTypeError): return {"response": response} # This code-path should be unreachable
The exception raised by async .json() call has changed.
diff --git a/packages/cozy-client/src/models/accounts.js b/packages/cozy-client/src/models/accounts.js index <HASH>..<HASH> 100644 --- a/packages/cozy-client/src/models/accounts.js +++ b/packages/cozy-client/src/models/accounts.js @@ -5,7 +5,7 @@ import get from 'lodash/get' * * @param {object} account io.cozy.accounts * - * @returns {Array} AN array of errors with a `type` and `mutedAt` field + * @returns {Array} An array of errors with a `type` and `mutedAt` field */ export const getMutedErrors = account => get(account, 'mutedErrors', [])
Update packages/cozy-client/src/models/accounts.js
diff --git a/circuits.js b/circuits.js index <HASH>..<HASH> 100644 --- a/circuits.js +++ b/circuits.js @@ -165,12 +165,12 @@ Circuits.prototype.handleRequest = function handleRequest(req, buildRes, nextHan var arg1 = String(req.arg1); var circuit = self.getCircuit(callerName, serviceName, arg1); - if (circuit.state.shouldRequest()) { - buildRes = circuit.monitorRequest(req, buildRes); - return nextHandler.handleRequest(req, buildRes); - } else { + if (!circuit.state.shouldRequest()) { return buildRes().sendError('Declined', 'Service is not healthy'); } + + buildRes = circuit.monitorRequest(req, buildRes); + return nextHandler.handleRequest(req, buildRes); }; // Called upon membership change to collect services that the corresponding
Circuits: normalize declined path in #handleRequest
diff --git a/src/js/modules/metrics.js b/src/js/modules/metrics.js index <HASH>..<HASH> 100644 --- a/src/js/modules/metrics.js +++ b/src/js/modules/metrics.js @@ -1,6 +1,6 @@ import {apiUri} from '../../../config' -import {checkFetchStatus} from './utilities' import fetch from 'isomorphic-fetch' +import {checkFetchStatus, defaultFetchOptions} from './utilities' export const FAILURE = 'safe-app/metrics/FAILURE' export const REQUEST = 'safe-app/metrics/REQUEST' @@ -27,6 +27,7 @@ export const sendMetrics = (data) => return fetch(`${apiUri}/metrics`, { + ...defaultFetchOptions, method: 'POST', headers: { 'Accept': 'application/json',
Closes #<I>. Fixed user session issue
diff --git a/addon/components/sl-chart.js b/addon/components/sl-chart.js index <HASH>..<HASH> 100755 --- a/addon/components/sl-chart.js +++ b/addon/components/sl-chart.js @@ -162,8 +162,6 @@ export default Ember.Component.extend({ function() { const chartStyle = { fontFamily: [ - '"Benton Sans"', - '"Helvetica Neue"', 'Helvetica', 'Arial', 'sans-serif'
Remove font family entries in sl-chart
diff --git a/src/main/groovy/util/logging/Log4j2.java b/src/main/groovy/util/logging/Log4j2.java index <HASH>..<HASH> 100644 --- a/src/main/groovy/util/logging/Log4j2.java +++ b/src/main/groovy/util/logging/Log4j2.java @@ -53,7 +53,7 @@ import org.objectweb.asm.Opcodes; * If the expression exp is a constant or only a variable access the method call will * not be transformed. But this will still cause a call on the injected logger. * - * @since 2.3.0 + * @since 2.2.0 */ @java.lang.annotation.Documented @Retention(RetentionPolicy.SOURCE)
set since version to <I>
diff --git a/spec/swagger_v2/api_swagger_v2_format-content_type_spec.rb b/spec/swagger_v2/api_swagger_v2_format-content_type_spec.rb index <HASH>..<HASH> 100644 --- a/spec/swagger_v2/api_swagger_v2_format-content_type_spec.rb +++ b/spec/swagger_v2/api_swagger_v2_format-content_type_spec.rb @@ -41,7 +41,7 @@ describe 'format, content_type' do { 'declared_params' => declared(params) } end - desc 'This uses produces for produces', + desc 'This uses consumes for consumes', failure: [{ code: 400, model: Entities::ApiError }], consumes: ['application/www_url_encoded'], entity: Entities::UseResponse
Spec: rename an it clause to match test - this text edit fixes #<I>
diff --git a/js/huobipro.js b/js/huobipro.js index <HASH>..<HASH> 100644 --- a/js/huobipro.js +++ b/js/huobipro.js @@ -791,9 +791,9 @@ module.exports = class huobipro extends Exchange { await this.loadMarkets (); await this.loadAccounts (); const market = this.market (symbol); - - let requestAmount = ((type === 'market') && (side === 'buy')) ? this.valueToPrecision (symbol, amount) : this.amountToPrecision (symbol, amount); - + // market buy order need to use the value precision. + // market order buy amount means the amount of base currency. amount-precision is applied on quote currency + const requestAmount = ((type === 'market') && (side === 'buy')) ? this.valueToPrecision (symbol, amount) : this.amountToPrecision (symbol, amount); const request = { 'account-id': this.accounts[0]['id'], 'amount': requestAmount,
fix the huobipro market buy order amount issue
diff --git a/src/main/java/au/com/southsky/jfreesane/FrameInputStream.java b/src/main/java/au/com/southsky/jfreesane/FrameInputStream.java index <HASH>..<HASH> 100644 --- a/src/main/java/au/com/southsky/jfreesane/FrameInputStream.java +++ b/src/main/java/au/com/southsky/jfreesane/FrameInputStream.java @@ -46,12 +46,11 @@ class FrameInputStream extends InputStream { while (readRecord(bigArray) >= 0); if (imageSize > 0 && bigArray.size() < imageSize) { + int difference = imageSize - bigArray.size(); log.log(Level.WARNING, "truncated read (got {0}, expected {1} bytes)", new Object[] { bigArray.size(), imageSize }); - for (int i = 0; i < imageSize - bigArray.size(); i++) { - bigArray.write(0); - } - log.log(Level.WARNING, "padded image with {0} null bytes", imageSize - bigArray.size()); + bigArray.write(new byte[difference]); + log.log(Level.WARNING, "padded image with {0} null bytes", difference); } // Now, if necessary, put the bytes in the correct order according
Write a byte array rather than individual bytes
diff --git a/jwcrypto/jwa.py b/jwcrypto/jwa.py index <HASH>..<HASH> 100644 --- a/jwcrypto/jwa.py +++ b/jwcrypto/jwa.py @@ -828,7 +828,7 @@ class _EcdhEsAes192Kw(_EcdhEs): class _EcdhEsAes256Kw(_EcdhEs): name = 'ECDH-ES+A256KW' - description = 'ECDH-ES using Concat KDF and "A128KW" wrapping' + description = 'ECDH-ES using Concat KDF and "A256KW" wrapping' keysize = 256 algorithm_usage_location = 'alg' algorithm_use = 'kex'
Fixing "A<I>KW" under "_EcdhEsAes<I>Kw" There was a typo in the "_EcdhEsAes<I>Kw" class. I have changed "A<I>KW" in the description for the class to become "A<I>KW" in accordance with the algorithm.
diff --git a/pusher/sync.py b/pusher/sync.py index <HASH>..<HASH> 100644 --- a/pusher/sync.py +++ b/pusher/sync.py @@ -19,9 +19,6 @@ class SynchronousBackend(object): self.config = config self.timeout = timeout if config.ssl: - if sys.version_info < (3,4): - raise NotImplementedError("SSL requires python >= 3.4, earlier versions don't support certificate validation") - ctx = ssl.create_default_context() self.http = http_client.HTTPSConnection(self.config.host, self.config.port, timeout=self.timeout, context=ctx) else:
Remove artificial restriction on sync+SSL
diff --git a/OpenSSL/test/test_crypto.py b/OpenSSL/test/test_crypto.py index <HASH>..<HASH> 100644 --- a/OpenSSL/test/test_crypto.py +++ b/OpenSSL/test/test_crypto.py @@ -2603,7 +2603,7 @@ class CRLTests(TestCase): def test_export_invalid(self): """ If :py:obj:`CRL.export` is used with an uninitialized :py:obj:`X509` - instance, :py:obj:`ValueError` is raised. + instance, :py:obj:`OpenSSL.crypto.Error` is raised. """ crl = CRL() self.assertRaises(Error, crl.export, X509(), PKey())
Fix an incorrect exception name in a test method docstring.
diff --git a/lib/svtplay_dl/service/dplay.py b/lib/svtplay_dl/service/dplay.py index <HASH>..<HASH> 100644 --- a/lib/svtplay_dl/service/dplay.py +++ b/lib/svtplay_dl/service/dplay.py @@ -17,7 +17,7 @@ from svtplay_dl.utils import filenamify from svtplay_dl.log import log class Dplay(Service): - supported_domains = ['dplay.se'] + supported_domains = ['dplay.se', 'dplay.dk', "it.dplay.com"] def get(self, options): data = self.get_urldata()
dplay: support for dplay.dk and it.dplay.com
diff --git a/src/requirementslib/models/utils.py b/src/requirementslib/models/utils.py index <HASH>..<HASH> 100644 --- a/src/requirementslib/models/utils.py +++ b/src/requirementslib/models/utils.py @@ -120,7 +120,6 @@ def validate_vcs(instance, attr_, value): def validate_path(instance, attr_, value): - return True if not os.path.exists(value): raise ValueError("Invalid path {0!r}", format(value)) diff --git a/src/requirementslib/utils.py b/src/requirementslib/utils.py index <HASH>..<HASH> 100644 --- a/src/requirementslib/utils.py +++ b/src/requirementslib/utils.py @@ -64,7 +64,11 @@ def is_vcs(pipfile_entry): def get_converted_relative_path(path, relative_to=os.curdir): """Given a vague relative path, return the path relative to the given location""" - start = Path(relative_to).resolve() + start = Path(relative_to) + try: + start = start.resolve() + except OSError: + start = start.absolute() path = start.joinpath('.', path).relative_to(start) # Normalize these to use forward slashes even on windows if os.name == 'nt':
Fix a bug related to ramdisks and pathlib resolve
diff --git a/tests/CarbonPeriod/SettersTest.php b/tests/CarbonPeriod/SettersTest.php index <HASH>..<HASH> 100644 --- a/tests/CarbonPeriod/SettersTest.php +++ b/tests/CarbonPeriod/SettersTest.php @@ -460,13 +460,13 @@ class SettersTest extends AbstractTestCase $this->assertSame('2018-03-25 12:00 Europe/Oslo', $period->getEndDate()->format('Y-m-d H:i e')); $period = CarbonPeriod::create( - '2018-03-25 00:00 America/Toronto', + '2018-03-26 00:00 America/Toronto', 'PT1H', 5 )->shiftTimezone('Europe/Oslo'); - $this->assertSame('2018-03-25 00:00 Europe/Oslo', $period->getStartDate()->format('Y-m-d H:i e')); + $this->assertSame('2018-03-26 00:00 Europe/Oslo', $period->getStartDate()->format('Y-m-d H:i e')); $this->assertNull($period->getEndDate()); - $this->assertSame('2018-03-25 04:00 Europe/Oslo', $period->calculateEnd()->format('Y-m-d H:i e')); + $this->assertSame('2018-03-26 04:00 Europe/Oslo', $period->calculateEnd()->format('Y-m-d H:i e')); } }
Avoid DST as it change in PHP <I>
diff --git a/widgets/SimpleNav.php b/widgets/SimpleNav.php index <HASH>..<HASH> 100644 --- a/widgets/SimpleNav.php +++ b/widgets/SimpleNav.php @@ -66,7 +66,7 @@ class SimpleNav extends \yii\bootstrap\Widget Html::addCssClass($this->options, 'nav'); //activate parents if desired - if ($this->activateParents) { + if ($this->activateItems) { foreach ($this->items as &$item) { $this->activateItems($item); }
bugfix with using old varname in SimpleNav-widget
diff --git a/lib/Widget/Validator.php b/lib/Widget/Validator.php index <HASH>..<HASH> 100644 --- a/lib/Widget/Validator.php +++ b/lib/Widget/Validator.php @@ -9,6 +9,7 @@ namespace Widget; use Widget\Validator\AbstractValidator; +use Widget\Validator\ValidatorInterface; /** * Validator @@ -172,7 +173,7 @@ class Validator extends AbstractValidator */ if (is_string($rules)) { $rules = array($rules => true); - } elseif ($rules instanceof AbstractValidator) { + } elseif ($rules instanceof ValidatorInterface) { $rules = array($rules); } elseif (!is_array($rules)) { throw new UnexpectedTypeException($rules, 'array, string or instance of AbstractValidator');
used interface for instanceof instead of abstract class
diff --git a/server/src/main/java/io/atomix/copycat/server/state/ServerSessionContext.java b/server/src/main/java/io/atomix/copycat/server/state/ServerSessionContext.java index <HASH>..<HASH> 100644 --- a/server/src/main/java/io/atomix/copycat/server/state/ServerSessionContext.java +++ b/server/src/main/java/io/atomix/copycat/server/state/ServerSessionContext.java @@ -640,7 +640,7 @@ class ServerSessionContext implements ServerSession { PublishRequest request = PublishRequest.builder() .withSession(id()) .withEventIndex(event.eventIndex) - .withPreviousIndex(event.previousIndex) + .withPreviousIndex(Math.max(event.previousIndex, completeIndex)) .withEvents(event.events) .build();
Ensure EventHolder previousIndex is >= completeIndex
diff --git a/php/test/test.php b/php/test/test.php index <HASH>..<HASH> 100644 --- a/php/test/test.php +++ b/php/test/test.php @@ -114,7 +114,7 @@ function test_trades($exchange, $symbol) { function test_symbol($exchange, $symbol) { test_ticker($exchange, $symbol); - if ('coinmarketcap' == $exchange->id) { + if ($exchange->id === 'coinmarketcap') { dump(var_export($exchange->fetchGlobal())); } else { test_order_book($exchange, $symbol); @@ -193,7 +193,7 @@ function test_exchange($exchange) { } } - if (false === strpos($symbol, '.d')) { + if (strpos($symbol, '.d') === false) { dump(green('SYMBOL:'), green($symbol)); test_symbol($exchange, $symbol);
test.php l-val ←→ r-val in `if` clauses
diff --git a/src/main/java/azkaban/utils/PropsUtils.java b/src/main/java/azkaban/utils/PropsUtils.java index <HASH>..<HASH> 100644 --- a/src/main/java/azkaban/utils/PropsUtils.java +++ b/src/main/java/azkaban/utils/PropsUtils.java @@ -269,7 +269,6 @@ public class PropsUtils { } String newValue = value.substring(0, lastIndex) + result.toString() + value.substring(nextClosed + 1); - System.out.println("Value " + newValue); return resolveVariableExpression(newValue, lastIndex, jexl); }
Removing errant Sys out statement
diff --git a/src/model/specials/GlobalModel.js b/src/model/specials/GlobalModel.js index <HASH>..<HASH> 100644 --- a/src/model/specials/GlobalModel.js +++ b/src/model/specials/GlobalModel.js @@ -10,6 +10,10 @@ class GlobalModel extends Model { this.adaptors = []; this.changes = {}; } + + getKeypath() { + return '@global'; + } } export default new GlobalModel(); diff --git a/src/model/specials/RactiveModel.js b/src/model/specials/RactiveModel.js index <HASH>..<HASH> 100644 --- a/src/model/specials/RactiveModel.js +++ b/src/model/specials/RactiveModel.js @@ -10,4 +10,8 @@ export default class RactiveModel extends Model { this.ractive = ractive; this.changes = {}; } + + getKeypath() { + return '@ractive'; + } }
return appropriate keypath for ractive and global special models
diff --git a/lib/ore/versions/version_constant.rb b/lib/ore/versions/version_constant.rb index <HASH>..<HASH> 100644 --- a/lib/ore/versions/version_constant.rb +++ b/lib/ore/versions/version_constant.rb @@ -52,7 +52,9 @@ module Ore file.each_line do |line| unless line =~ /^\s*#/ # skip commented lines if line =~ /(VERSION|Version)\s*=\s*/ - return self.parse(extract_version(line)) + version = extract_version(line) + + return self.parse(version) if version elsif line =~ /(MAJOR|Major)\s*=\s*/ major ||= extract_number(line) elsif line =~ /(MINOR|Minor)\s*=\s*/
Be more careful when extracting version constants.
diff --git a/rest_registration/__init__.py b/rest_registration/__init__.py index <HASH>..<HASH> 100644 --- a/rest_registration/__init__.py +++ b/rest_registration/__init__.py @@ -1,2 +1,2 @@ -__version__ = "0.5.3" +__version__ = "0.5.4" default_app_config = 'rest_registration.apps.RestRegistrationConfig'
Version <I> Changes: * Re-enable Django <I> and DRF <I> support (issue #<I>) * Put the code for sending the register verification email in separate `send_register_verification_email_notification` (issue #<I>)
diff --git a/src/ocrmypdf/leptonica.py b/src/ocrmypdf/leptonica.py index <HASH>..<HASH> 100644 --- a/src/ocrmypdf/leptonica.py +++ b/src/ocrmypdf/leptonica.py @@ -24,6 +24,7 @@ import argparse import sys import os import logging +import warnings from tempfile import TemporaryFile from ctypes.util import find_library from .lib._leptonica import ffi @@ -217,11 +218,12 @@ class Pix: return 'P' @classmethod - def open(cls, path): - return cls.read(path) + def read(cls, path): + warnings.warn('Use Pix.open() instead', DeprecationWarning) + return cls.open(path) @classmethod - def read(cls, path): + def open(cls, path): """Load an image file into a PIX object. Leptonica can load TIFF, PNM (PBM, PGM, PPM), PNG, and JPEG. If
Deprecate Pix.read() behaving as an open function
diff --git a/lib/rbgccxml/node_cache.rb b/lib/rbgccxml/node_cache.rb index <HASH>..<HASH> 100644 --- a/lib/rbgccxml/node_cache.rb +++ b/lib/rbgccxml/node_cache.rb @@ -29,11 +29,16 @@ module RbGCCXML @index_list[id] end + # Given an array of ids return an array of nodes that match + def find_by_ids(ids) + QueryResult.new(ids.map {|id| @index_list[id] }) + end + # Look through the DOM under +node+ for +type+ nodes. # +type+ must be the string name of an existing Node subclass. # # Returns a QueryResult with the findings. - def find_children_of_type(node, type, matcher) + def find_children_of_type(node, type, matcher = nil) results = QueryResult.new(self.select_nodes_of_type(node.children, type)) results = results.find(:name => matcher) if matcher results
Can find a set of nodes given a set of ids
diff --git a/src/Co.php b/src/Co.php index <HASH>..<HASH> 100644 --- a/src/Co.php +++ b/src/Co.php @@ -8,7 +8,6 @@ use Swoole\Coroutine; /** * Class Co * @since 2.0 - * @package Swoft */ class Co { @@ -59,11 +58,11 @@ class Co { $tid = self::tid(); - // return coroutine ID for created. + // Return coroutine ID on created. return \go(function () use ($callable, $tid) { try { $id = Coroutine::getCid(); - + // Storage fd self::$mapping[$id] = $tid; PhpHelper::call($callable); } catch (\Throwable $e) {
update some logic for ws server
diff --git a/user/index.php b/user/index.php index <HASH>..<HASH> 100644 --- a/user/index.php +++ b/user/index.php @@ -68,6 +68,9 @@ foreach ($students as $student) { print_user($student, $course, $string); } + } else if ($numstudents > $USER_HUGE_CLASS) { + print_heading(get_string("toomanytoshow")); + } else { // Print one big table with abbreviated info $columns = array("name", "city", "country", "lastaccess"); diff --git a/user/lib.php b/user/lib.php index <HASH>..<HASH> 100644 --- a/user/lib.php +++ b/user/lib.php @@ -2,6 +2,7 @@ $USER_SMALL_CLASS = 20; // Below this is considered small $USER_LARGE_CLASS = 200; // Above this is considered large +$USER_HUGE_CLASS = 500; // Above this is considered too many to display /// FUNCTIONS ///////////////////////////////////////////////////////////
For very large classes don't even try to show all the participants
diff --git a/alerta/app/webhooks/views.py b/alerta/app/webhooks/views.py index <HASH>..<HASH> 100644 --- a/alerta/app/webhooks/views.py +++ b/alerta/app/webhooks/views.py @@ -372,16 +372,19 @@ def parse_stackdriver(notification): try: alert = db.get_alerts(query={'attributes.incidentId': incident['incident_id']}, limit=1)[0] except IndexError: - raise + raise ValueError('unknown Stackdriver Incident ID: %s' % incident['incident_id']) return state, alert else: if state == 'open': severity = 'critical' + create_time = datetime.datetime.fromtimestamp(incident['started_at']) elif state == 'closed': severity = 'ok' + create_time = datetime.datetime.fromtimestamp(incident['ended_at']) else: severity = 'indeterminate' + create_time = None return state, Alert( resource=incident['resource_name'], @@ -398,7 +401,8 @@ def parse_stackdriver(notification): }, origin='Stackdriver', event_type='stackdriverAlert', - raw_data=notification, + create_time=create_time, + raw_data=notification )
Add create time and catch unknown incident IDs
diff --git a/Exedra/Application/Map/Convenient/Group.php b/Exedra/Application/Map/Convenient/Group.php index <HASH>..<HASH> 100644 --- a/Exedra/Application/Map/Convenient/Group.php +++ b/Exedra/Application/Map/Convenient/Group.php @@ -11,7 +11,9 @@ class Group extends \Exedra\Application\Map\Level */ public function add($method = null, $path = null, $params = null) { - $parameters = array('uri' => $path); + $parameters = array(); + + $parameters['uri'] = $path === null ? '' : $path; if($method) $parameters['method'] = $method; diff --git a/Exedra/Application/Map/Route.php b/Exedra/Application/Map/Route.php index <HASH>..<HASH> 100644 --- a/Exedra/Application/Map/Route.php +++ b/Exedra/Application/Map/Route.php @@ -303,7 +303,7 @@ class Route { $continue = true; - $routeURI = $this->getParameter('uri'); + $routeURI = ltrim($this->getParameter('uri'), '/'); if($routeURI === false) return false; @@ -537,6 +537,13 @@ class Route return isset($this->parameters['execute']); } + public function setName($name) + { + $this->name = $name; + + return $this; + } + public function setBase($baseRoute) { $this->setParameter('base', $baseRoute);
Convenient Routing : empty uri on passed default - and added setName on Map\Route for renaming capability - ltrim / from each uri on validation
diff --git a/i3ipc/aio/connection.py b/i3ipc/aio/connection.py index <HASH>..<HASH> 100644 --- a/i3ipc/aio/connection.py +++ b/i3ipc/aio/connection.py @@ -459,7 +459,16 @@ class Connection: assert magic == _MAGIC try: - message = await self._loop.sock_recv(self._cmd_socket, message_length) + message = b'' + remaining_length = message_length + while remaining_length: + buf = await self._loop.sock_recv(self._cmd_socket, remaining_length) + if not buf: + logger.error('premature ending while reading message (%s bytes remaining)', + remaining_length) + break + message += buf + remaining_length -= len(buf) except ConnectionError as e: if self._auto_reconnect: ensure_future(self._reconnect())
aio: Read all message_length bytes from message response `sock_recv` reads up to the specified amount of bytes, and can in some situations return less than the requested amount. Make sure we read all `message_length` bytes of the response before returning.
diff --git a/Classes/Backend/LayoutSetup.php b/Classes/Backend/LayoutSetup.php index <HASH>..<HASH> 100644 --- a/Classes/Backend/LayoutSetup.php +++ b/Classes/Backend/LayoutSetup.php @@ -74,6 +74,10 @@ class LayoutSetup $this->setDatabaseConnection($GLOBALS['TYPO3_DB']); $this->setLanguageService($GLOBALS['LANG']); $pageId = (strpos($pageId, 'NEW') === 0) ? 0 : (int)$pageId; + if ($pageId < 0) { + $pidRecord = BackendUtility::getRecord('tt_content', abs($pageId), 'pid'); + $pageId = is_array($pidRecord) ? (int)$pidRecord['pid'] : 0; + } $this->loadLayoutSetup($pageId); foreach ($this->layoutSetup as $key => $setup) { $columns = $this->getLayoutColumns($key);
[BUGFIX] Get correct PID since negative IDs point to content records Change-Id: Ide<I>a<I>e4af<I>d<I>a<I>f<I>df<I> Resolves: #<I> Releases: master, 7-0 Reviewed-on: <URL>
diff --git a/spec/RequestSpec.php b/spec/RequestSpec.php index <HASH>..<HASH> 100644 --- a/spec/RequestSpec.php +++ b/spec/RequestSpec.php @@ -87,6 +87,13 @@ class RequestSpec extends ObjectBehavior $request->getPaginationType()->shouldReturn(Request::CURSOR_PAGINATION); } + public function it_can_set_included_resources_returning_a_new_request_object() + { + $request = $this->withIncludedResources('resources'); + $request->shouldHaveType(Request::class); + $request->getIncludedResources()->shouldReturn('resources'); + } + public function it_returns_empty_array_when_no_offset_limit_is_set() { $this->getOffsetLimit()->shouldReturn([]); diff --git a/src/Request.php b/src/Request.php index <HASH>..<HASH> 100644 --- a/src/Request.php +++ b/src/Request.php @@ -337,4 +337,12 @@ class Request extends ServerRequest { return $this->afterCursor; } + + public function withIncludedResources($includedResources) + { + $new = clone $this; + $new->includedResources = $includedResources; + + return $new; + } }
Add ability to set included resources immutably
diff --git a/lib/commands/travis-visual-acceptance.js b/lib/commands/travis-visual-acceptance.js index <HASH>..<HASH> 100644 --- a/lib/commands/travis-visual-acceptance.js +++ b/lib/commands/travis-visual-acceptance.js @@ -101,13 +101,11 @@ module.exports = { var prNumber = process.env.TRAVIS_PULL_REQUEST - if (prNumber !== false && prNumber !== 'false' && process.env.VISUAL_ACCEPTANCE_TOKEN) { + if (prNumber !== false && prNumber !== 'false' && process.env.VISUAL_ACCEPTANCE_TOKEN && options.msgOn === options.msgVar) { return runCommand(this, 'br').then(buildReport, function (params) { - if (options.msgOn === options.msgVar) { - return buildReport(params).then(function (params) { - throw new Error('Exit 1') - }) - } + return buildReport(params).then(function (params) { + throw new Error('Exit 1') + }) }) } else if (prNumber === false || prNumber === 'false') { return runCommand(this, 'new-baseline', [
Wrap the creation of the repo with condition
diff --git a/Testing/Fakes/EventFake.php b/Testing/Fakes/EventFake.php index <HASH>..<HASH> 100644 --- a/Testing/Fakes/EventFake.php +++ b/Testing/Fakes/EventFake.php @@ -135,7 +135,7 @@ class EventFake implements Dispatcher */ public function listen($events, $listener) { - // + $this->dispatcher->listen($events, $listener); } /** @@ -146,7 +146,7 @@ class EventFake implements Dispatcher */ public function hasListeners($eventName) { - // + return $this->dispatcher->hasListeners($eventName); } /** @@ -169,7 +169,7 @@ class EventFake implements Dispatcher */ public function subscribe($subscriber) { - // + $this->dispatcher->subscribe($subscriber); } /**
Non faked events should be properly dispatched (#<I>)
diff --git a/lib/flapjack/utility.rb b/lib/flapjack/utility.rb index <HASH>..<HASH> 100644 --- a/lib/flapjack/utility.rb +++ b/lib/flapjack/utility.rb @@ -7,10 +7,10 @@ module Flapjack period_mm, period_ss = period.divmod(60) period_hh, period_mm = period_mm.divmod(60) period_dd, period_hh = period_hh.divmod(24) - ["#{period_dd} days", - "#{period_hh} hours", - "#{period_mm} minutes", - "#{period_ss} seconds"].reject {|s| s =~ /^0 /}.join(', ') + ["#{period_dd} day#{plural_s(period_dd)}", + "#{period_hh} hour#{plural_s(period_hh)}", + "#{period_mm} minute#{plural_s(period_mm)}", + "#{period_ss} second#{plural_s(period_ss)}"].reject {|s| s =~ /^0 /}.join(', ') end # Returns relative time in words referencing the given date @@ -68,5 +68,11 @@ module Flapjack Hash[ *( key_value_pairs.flatten(1) )] end + private + + def plural_s(value) + (value == 1) ? '' : 's' + end + end end
don't pluralise singular time periods
diff --git a/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoderProxy.php b/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoderProxy.php index <HASH>..<HASH> 100644 --- a/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoderProxy.php +++ b/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoderProxy.php @@ -61,6 +61,7 @@ class Swift_Mime_ContentEncoder_QpContentEncoderProxy implements Swift_Mime_Cont public function charsetChanged($charset) { $this->charset = $charset; + $this->safeEncoder->charsetChanged($charset); } /**
Pass charsetChanged() call to the safeEncoder
diff --git a/server/src/main/java/io/druid/query/lookup/LookupModule.java b/server/src/main/java/io/druid/query/lookup/LookupModule.java index <HASH>..<HASH> 100644 --- a/server/src/main/java/io/druid/query/lookup/LookupModule.java +++ b/server/src/main/java/io/druid/query/lookup/LookupModule.java @@ -118,7 +118,8 @@ class LookupListeningResource extends ListenerResource for (final String name : lookups.keySet()) { final LookupExtractorFactory factory = lookups.get(name); try { - if (!manager.updateIfNew(name, factory)) { + // Only fail if it should have updated but didn't. + if (!manager.updateIfNew(name, factory) && factory.replaces(manager.get(name))) { failedUpdates.put(name, factory); } }
Make lookups more idempotent on update requests. (#<I>) * No longer fails if an update fails but it shouldn't have replaced it
diff --git a/build/populate.js b/build/populate.js index <HASH>..<HASH> 100644 --- a/build/populate.js +++ b/build/populate.js @@ -26,7 +26,9 @@ var populateBin = function (ownerBin, done) { if (err) return done(err); ownerBin.summary = utils.titleForBin(sandboxBin); - ownerBin.date = ownerBin.last_updated; + + if (!ownerBin.last_updated || isNaN(ownerBin.last_updated.getTime())) ownerBin.date = new Date('2012-07-23 00:00:00'); + store.touchOwnership(ownerBin, done); }); };
Fixed Tom's code. Duh
diff --git a/mlbgame/game.py b/mlbgame/game.py index <HASH>..<HASH> 100644 --- a/mlbgame/game.py +++ b/mlbgame/game.py @@ -252,4 +252,35 @@ def get_stats(game_id): elif not home: away_batting.append(stats) output = {'home_pitching':home_pitching, 'away_pitching':away_pitching, 'home_batting':home_batting, 'away_batting':away_batting} - return output \ No newline at end of file + return output + +class GameStats(): + ''' + Holds stat object for all players in a game + ''' + pass + +class PitcherStats(object): + ''' + Holds stats information for a pitcher + ''' + def __init__(self, data): + ''' + Creates a pitcher object that matches the corresponding stats in `data` + + `data` should be a dictionary for a single pitcher that comes from `get_stats()` + ''' + for x in data: + try: + setattr(self, x, int(data[x])) + except ValueError: + setattr(self, x, data[x]) + + def nice_output(self): + ''' + Prints basic player stats in a nice way + ''' + return "%s - %i Earned Runs, %i Strikouts, %i Hits" % (self.name, self.er, self.so, self.h) + + def __str__(self): + return self.nice_output() \ No newline at end of file
Better printing and store numbers as ints
diff --git a/indra/preassembler/grounding_mapper.py b/indra/preassembler/grounding_mapper.py index <HASH>..<HASH> 100644 --- a/indra/preassembler/grounding_mapper.py +++ b/indra/preassembler/grounding_mapper.py @@ -53,7 +53,7 @@ class GroundingMapper(object): up_id = map_db_refs.get('UP') hgnc_sym = map_db_refs.get('HGNC') if up_id and not hgnc_sym: - gene_name = uniprot_client.get_gene_name(up_id) + gene_name = uniprot_client.get_gene_name(up_id, False) if gene_name: hgnc_id = hgnc_client.get_hgnc_id(gene_name) if hgnc_id:
Don't force web fallback for gene name lookup
diff --git a/src/main/java/com/samskivert/net/MailUtil.java b/src/main/java/com/samskivert/net/MailUtil.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/samskivert/net/MailUtil.java +++ b/src/main/java/com/samskivert/net/MailUtil.java @@ -136,7 +136,7 @@ public class MailUtil } message.saveChanges(); Address[] recips = message.getAllRecipients(); - if (recips.length == 0) { + if (recips == null || recips.length == 0) { log.info("Not sending mail to zero recipients", "subject", subject, "message", message); return;
Protect from stupid null usage by javax.mail. If you add no addresses to a message, getting the recipient array returns null rather than an empty array. So fucking dumb.
diff --git a/spec/rails_best_practices/reviews/remove_unused_methods_in_controllers_review_spec.rb b/spec/rails_best_practices/reviews/remove_unused_methods_in_controllers_review_spec.rb index <HASH>..<HASH> 100644 --- a/spec/rails_best_practices/reviews/remove_unused_methods_in_controllers_review_spec.rb +++ b/spec/rails_best_practices/reviews/remove_unused_methods_in_controllers_review_spec.rb @@ -156,6 +156,21 @@ describe RailsBestPractices::Reviews::RemoveUnusedMethodsInControllersReview do end context "helper_method" do + it "should remove unused methods when helper method is not called" do + content = <<-EOF + class PostsController < ApplicationController + helper_method :helper_post + protected + def helper_post; end + end + EOF + runner.prepare('app/controllers/posts_controller.rb', content) + runner.review('app/controllers/posts_controller.rb', content) + runner.on_complete + runner.should have(1).errors + runner.errors[0].to_s.should == "app/controllers/posts_controller.rb:4 - remove unused methods (PostsController#helper_post)" + end + it "should not remove unused methods when call helper method in views" do content = <<-EOF class PostsController < ApplicationController
remove unused method in controllers if it is a helper method but not called
diff --git a/b2handle/tests/main_test_script.py b/b2handle/tests/main_test_script.py index <HASH>..<HASH> 100644 --- a/b2handle/tests/main_test_script.py +++ b/b2handle/tests/main_test_script.py @@ -90,9 +90,9 @@ if __name__ == '__main__': numtests += n print 'Number of tests for client (no access required):\t\t\t\t'+str(n) - noaccess = unittest.TestLoader().loadTestsFromTestCase(EUDATHandleConnectorNoaccessTestCase) - tests_to_run.append(noaccess) - n = noaccess.countTestCases() + noaccess_connector = unittest.TestLoader().loadTestsFromTestCase(EUDATHandleConnectorNoaccessTestCase) + tests_to_run.append(noaccess_connector) + n = noaccess_connector.countTestCases() numtests += n print 'Number of tests for handle system connector (no access required):\t\t\t\t'+str(n)
Bugfix: Changed name of test file.
diff --git a/src/loader/loader.js b/src/loader/loader.js index <HASH>..<HASH> 100644 --- a/src/loader/loader.js +++ b/src/loader/loader.js @@ -195,7 +195,7 @@ var httpReq = new XMLHttpRequest(); // load our file - httpReq.open("GET", data.src + obj.nocache, false); + httpReq.open("GET", data.src + obj.nocache, true); httpReq.responseType = "arraybuffer"; httpReq.onerror = onerror; httpReq.onload = function(event){ @@ -203,11 +203,10 @@ if (arrayBuffer) { var byteArray = new Uint8Array(arrayBuffer); var buffer = []; - binList[data.name] = new dataType(); for (var i = 0; i < byteArray.byteLength; i++) { buffer[i] = String.fromCharCode(byteArray[i]); } - binList[data.name].data = buffer.join(""); + binList[data.name] = buffer.join(""); // callback onload(); }
set binary load to async, and removed the usage of dataType
diff --git a/core/common/src/main/java/alluxio/RuntimeConstants.java b/core/common/src/main/java/alluxio/RuntimeConstants.java index <HASH>..<HASH> 100644 --- a/core/common/src/main/java/alluxio/RuntimeConstants.java +++ b/core/common/src/main/java/alluxio/RuntimeConstants.java @@ -19,11 +19,12 @@ import javax.annotation.concurrent.ThreadSafe; @ThreadSafe public final class RuntimeConstants { static { - VERSION = Configuration.get(PropertyKey.VERSION); - if (Configuration.get(PropertyKey.VERSION).endsWith("SNAPSHOT")) { + String version = Configuration.get(PropertyKey.VERSION); + VERSION = version; + if (version.endsWith("SNAPSHOT")) { ALLUXIO_DOCS_URL = "http://www.alluxio.org/docs/master"; } else { - String[] majorMinor = Configuration.get(PropertyKey.VERSION).split("\\."); + String[] majorMinor = version.split("\\."); ALLUXIO_DOCS_URL = String.format( "http://www.alluxio.org/docs/%s.%s", majorMinor[0], majorMinor[1]); }
Do not get the same property value repeatedly in the same block.
diff --git a/CachedImage.js b/CachedImage.js index <HASH>..<HASH> 100644 --- a/CachedImage.js +++ b/CachedImage.js @@ -87,7 +87,7 @@ const CachedImage = React.createClass({ componentWillMount() { this._isMounted = true; - NetInfo.isConnected.addEventListener('change', this.handleConnectivityChange); + NetInfo.isConnected.addEventListener('connectionChange', this.handleConnectivityChange); // initial NetInfo.isConnected.fetch() .then(isConnected => { @@ -101,7 +101,7 @@ const CachedImage = React.createClass({ componentWillUnmount() { this._isMounted = false; - NetInfo.isConnected.removeEventListener('change', this.handleConnectivityChange); + NetInfo.isConnected.removeEventListener('connectionChange', this.handleConnectivityChange); }, componentWillReceiveProps(nextProps) {
Listen NetInfo connectionChange event (change deprecated)
diff --git a/pysat/constellations/single_test.py b/pysat/constellations/single_test.py index <HASH>..<HASH> 100644 --- a/pysat/constellations/single_test.py +++ b/pysat/constellations/single_test.py @@ -1,5 +1,11 @@ """ Create a constellation with one testing instrument + +Attributes +---------- +instruments : list + List of pysat.Instrument objects + """ import pysat diff --git a/pysat/constellations/testing.py b/pysat/constellations/testing.py index <HASH>..<HASH> 100644 --- a/pysat/constellations/testing.py +++ b/pysat/constellations/testing.py @@ -1,5 +1,11 @@ """ Creates a constellation with 5 testing instruments + +Attributes +---------- +instruments : list + List of pysat.Instrument objects + """ import pysat diff --git a/pysat/constellations/testing_empty.py b/pysat/constellations/testing_empty.py index <HASH>..<HASH> 100644 --- a/pysat/constellations/testing_empty.py +++ b/pysat/constellations/testing_empty.py @@ -1,5 +1,11 @@ """ Creates an empty constellation for testing + +Attributes +---------- +instruments : list + List of pysat.Instrument objects + """ instruments = []
DOC: updated docstrings Updated constellation testing docstrings.
diff --git a/bucky/statsd.py b/bucky/statsd.py index <HASH>..<HASH> 100644 --- a/bucky/statsd.py +++ b/bucky/statsd.py @@ -91,7 +91,6 @@ class StatsDHandler(threading.Thread): for k, v in self.gauges.iteritems(): stat = "stats.gauges.%s" % k self.enqueue(stat, v, stime) - self.gauges[k] = 0 ret += 1 return ret
Gauges are constant until overwritten, and not reset at flush time.