Skip to content

Commit

Permalink
8.7.2 bugfix release
Browse files Browse the repository at this point in the history
  • Loading branch information
kizniche committed Aug 23, 2020
1 parent 5e86ba4 commit 2c2f30c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## 8.7.2 (Unreleased)
## 8.7.2 (2020-08-23)

### Bugfixes

- Fix issue displaying Measurement Widgets when a Math measurement is selected ([#817](https://github.com/kizniche/mycodo/issues/817))
- Fix inability to generate Widget HTML ([#817](https://github.com/kizniche/mycodo/issues/817))
- Fix inability to generate Widget HTML ([#817](https://github.com/kizniche/mycodo/issues/817), [#822](https://github.com/kizniche/mycodo/issues/822))

### Features

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Mycodo

Environmental Regulation System

Latest version: 8.7.1
Latest version: 8.7.2

Mycodo is open source software for the Raspberry Pi that couples inputs and outputs in interesting ways to sense and manipulate the environment.

Expand Down
2 changes: 1 addition & 1 deletion mycodo/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
sys.path.append(os.path.abspath(os.path.dirname(__file__)))
from config_translations import TRANSLATIONS

MYCODO_VERSION = '8.7.1'
MYCODO_VERSION = '8.7.2'
ALEMBIC_VERSION = 'd66e33093e8e'

# FORCE_UPGRADE_MASTER
Expand Down
20 changes: 18 additions & 2 deletions mycodo/utils/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,35 @@
# along with Mycodo. If not, see <http://www.gnu.org/licenses/>.
#
# Contact at kylegabriel.com
import grp
import logging
import os
import pwd

from mycodo.config import PATH_HTML_USER
from mycodo.config import PATH_WIDGETS
from mycodo.config import PATH_WIDGETS_CUSTOM
from mycodo.utils.modules import load_module_from_file
from mycodo.utils.system_pi import assure_path_exists
from mycodo.utils.system_pi import set_user_grp

logger = logging.getLogger("mycodo.utils.widgets")


def set_user_grp(filepath, user, group):
""" Set the UID and GUID of a file """
uid = pwd.getpwnam(user).pw_uid
gid = grp.getgrnam(group).gr_gid
os.chown(filepath, uid, gid)


def assure_path_exists(path):
""" Create path if it doesn't exist """
if not os.path.exists(path):
os.makedirs(path)
os.chmod(path, 0o774)
set_user_grp(path, 'mycodo', 'mycodo')
return path


def generate_widget_html():
""" Generate all HTML files for all widgets """
dict_widgets = parse_widget_information()
Expand Down

0 comments on commit 2c2f30c

Please sign in to comment.