moved unittests for (formerly) internal pages to the appropriate plugins
added "do_unittests.sh" - this script should be used to run all unittests before commit fixed nasty "cannot-switch-languages"-bug fixed language data loading for plugins
This commit is contained in:
parent
e42902f641
commit
ada7458306
8 changed files with 91 additions and 34 deletions
|
@ -1,5 +1,6 @@
|
|||
import os
|
||||
import CryptoBoxContainer
|
||||
import CryptoBoxTools
|
||||
|
||||
## useful constant for some functions
|
||||
CONT_TYPES = CryptoBoxContainer.CryptoBoxContainer.Types
|
||||
|
@ -33,6 +34,7 @@ class WebInterfaceDataset(dict):
|
|||
self["Data.CurrentDisk.encryption"] = isEncrypted
|
||||
self["Data.CurrentDisk.plaintext"] = isPlain
|
||||
self["Data.CurrentDisk.active"] = isMounted
|
||||
self["Data.CurrentDisk.size"] = CryptoBoxTools.getBlockDeviceSizeHumanly(container.getDevice())
|
||||
if isMounted:
|
||||
(size, avail, used) = container.getCapacity()
|
||||
percent = used / size
|
||||
|
@ -56,6 +58,7 @@ class WebInterfaceDataset(dict):
|
|||
self["Data.Disks.%d.encryption" % avail_counter] = isEncrypted
|
||||
self["Data.Disks.%d.plaintext" % avail_counter] = isPlain
|
||||
self["Data.Disks.%d.active" % avail_counter] = isMounted
|
||||
self["Data.Disks.%d.size" % avail_counter] = CryptoBoxTools.getBlockDeviceSizeHumanly(container.getDevice())
|
||||
if isMounted: active_counter += 1
|
||||
avail_counter += 1
|
||||
self["Data.activeDisksCount"] = active_counter
|
||||
|
@ -75,7 +78,6 @@ class WebInterfaceDataset(dict):
|
|||
self["Data.Version"] = self.cbox.VERSION
|
||||
for lang in self.cbox.getAvailableLanguages():
|
||||
self["Data.Languages." + lang] = self.__getLanguageName(lang)
|
||||
## TODO: open issues: Data.Config.AdminPasswordIsSet
|
||||
|
||||
|
||||
def __getLanguageName(self, lang):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue