Skip to content

Commit

Permalink
cloud_py_api 0.1.2 (#51)
Browse files Browse the repository at this point in the history
* Fixed typo in function name

* cloud_py_api 0.1.2

* Minor js issues fixes

* Adjusted setting description

* Minor js changes
  • Loading branch information
andrey18106 authored Jan 16, 2023
1 parent 7838146 commit d75cba2
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 41 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

All notable changes to this project will be documented in this file.

## [0.1.2 - 2023-01-17]

### Added

- Added check of sha256 pre-compiled binary checksum

### Fixed

- Fixed incorrect pre-compiled binary download (for Alpine-based systems)
- Fixed escape colon symbol in logs file names

## [0.1.1 - 2022-12-23]

### Changed
Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ You can support us in several ways:
[![Liberapay](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/cloud_py_api/donate)
]]>
</description>
<version>0.1.1</version>
<version>0.1.2</version>
<licence>agpl</licence>
<author mail="[email protected]" homepage="https://github.com/andrey18106">Andrey Borysenko</author>
<author mail="[email protected]" homepage="https://github.com/bigcat88">Alexander Piskun</author>
Expand Down
4 changes: 2 additions & 2 deletions js/cloud_py_api-main.js

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions js/cloud_py_api-main.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@
* Released under the MIT License.
*/

/*!
* escape-html
* Copyright(c) 2012-2013 TJ Holowaychuk
* Copyright(c) 2015 Andreas Lubbe
* Copyright(c) 2015 Tiancheng "Timothy" Gu
* MIT Licensed
*/

/*! @license DOMPurify 2.4.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.3/LICENSE */

/*! For license information please see NcCheckboxRadioSwitch.js.LICENSE.txt */

/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
Expand Down
2 changes: 1 addition & 1 deletion js/cloud_py_api-main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/Migration/data/AppInitialData.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class AppInitialData {
"value" => 536870912,
"displayName" => "Remote/Encrypted file size limit to process",
"title" => "",
"description" => "Maximum file size for requesting from php core. Used when file hosts on remote NC instance or have encrypted flag. Must be less then total available RAM size.",
"description" => "Maximum file size (in GBytes) for requesting from php core. Used when file hosts on remote NC instance or have encrypted flag. Must be less then total available RAM size.",
"helpUrl" => "https://cloud-py-api.readthedocs.io/{todo-url:/settings/setting_name}"
],
[
Expand Down Expand Up @@ -89,7 +89,7 @@ private function _stringsForL10N(): void {
$this->l10n->t("Full path to python interpreter");
$this->l10n->t("Absolute path to the python runnable (e.g. \"/usr/bin/python3\"). Can be obtained by `which python3` command. Used when pre-compiled binaries option is not selected.");
$this->l10n->t("Remote/Encrypted file size limit to process");
$this->l10n->t("Maximum file size for requesting from php core. Used when file hosts on remote NC instance or have encrypted flag. Must be less then total available RAM size.");
$this->l10n->t("Maximum file size (in GBytes) for requesting from php core. Used when file hosts on remote NC instance or have encrypted flag. Must be less then total available RAM size.");
$this->l10n->t("Use path to PHP interpreter for Python from settings");
$this->l10n->t("Determine whether to use path from settings or detect it automatically (may not work with some unusual PHP install locations). Used in Python part.");
$this->l10n->t("Full path to PHP interpreter for Python");
Expand Down
4 changes: 2 additions & 2 deletions lib/Service/UtilsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public function isVideosSupported(): bool {
return $result;
}

public function isMusliLinux(): bool {
public function isMuslLinux(): bool {
exec('ldd --version 2>&1', $output, $result_code);
if (count($output) > 0 && str_contains($output[0], 'musl')) {
return true;
Expand Down Expand Up @@ -404,7 +404,7 @@ public function addChmodX(array $binariesFolder, string $file_name): bool {
* @return string part of binary name
*/
public function getBinaryName(): string {
if (!$this->isMusliLinux()) {
if (!$this->isMuslLinux()) {
$binaryName = 'manylinux_' . $this->getOsArch();
} else {
$binaryName = 'musllinux_' . $this->getOsArch();
Expand Down
52 changes: 26 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cloud_py_api",
"description": "Nextcloud Python API (Framework)",
"version": "0.1.1",
"version": "0.1.2",
"keywords": [
"nextcloud",
"python",
Expand Down
7 changes: 5 additions & 2 deletions src/components/settings/AdminSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ export default {
return axios.put(generateUrl('/apps/cloud_py_api/api/v1/settings'), { settings }).then(res => {
if (res.data.success) {
this.settings = res.data.updated_settings
this.settings.forEach(setting => {
this.mappedSettings[setting.name] = setting
})
}
return res
})
Expand Down Expand Up @@ -165,10 +168,10 @@ export default {
})
},
fromBytesToGBytes(bytes) {
return bytes / Math.pow(1024, 3)
return (bytes / Math.pow(1024, 3)).toFixed(1)
},
fromGBytesToBytes(GBytes) {
return GBytes * Math.pow(1024, 3)
return (GBytes * Math.pow(1024, 3)).toFixed(0)
},
updateRemoteFilesizeLimit() {
this.mappedSettings.remote_filesize_limit.value = this.fromGBytesToBytes(Number(this.remote_filesize_limit))
Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/Service/UtilsServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ function ($command, &$output, &$result_code) {
$this->assertEquals($expected, $result, 'Should return videos processing availability');
}

public function testIsMusliLinux() {
public function testIsMuslLinux() {
$expected = false;
$exec = $this->getFunctionMock('\OCA\Cloud_Py_API\Service', 'exec');
$exec->expects($this->any())
Expand All @@ -197,11 +197,11 @@ function ($command, &$output, &$result_code) {
$result_code = 1;
}
);
$result = $this->utils->isMusliLinux();
$result = $this->utils->isMuslLinux();
$this->assertEquals($expected, $result, 'Should return bool is musllinux');
}

public function testIsMusliLinuxWithOverride() {
public function testIsMuslLinuxWithOverride() {
$expected = true;
$exec = $this->getFunctionMock('\OCA\Cloud_Py_API\Service', 'exec');
$exec->expects($this->any())
Expand All @@ -212,7 +212,7 @@ function ($command, &$output, &$result_code) {
$result_code = 1;
}
);
$result = $this->utils->isMusliLinux();
$result = $this->utils->isMuslLinux();
$this->assertEquals($expected, $result, 'Should return true bool is musllinux');
}

Expand Down

0 comments on commit d75cba2

Please sign in to comment.