(self, address, privatekey=None, inner_path="content.json", publish=False, remove_missing_optional=False)
| 177 | logging.info("Site created!") |
| 178 | |
| 179 | def siteSign(self, address, privatekey=None, inner_path="content.json", publish=False, remove_missing_optional=False): |
| 180 | from Site.Site import Site |
| 181 | from Site import SiteManager |
| 182 | from Debug import Debug |
| 183 | SiteManager.site_manager.load() |
| 184 | logging.info("Signing site: %s..." % address) |
| 185 | site = Site(address, allow_create=False) |
| 186 | |
| 187 | if not privatekey: # If no privatekey defined |
| 188 | from User import UserManager |
| 189 | user = UserManager.user_manager.get() |
| 190 | if user: |
| 191 | site_data = user.getSiteData(address) |
| 192 | privatekey = site_data.get("privatekey") |
| 193 | else: |
| 194 | privatekey = None |
| 195 | if not privatekey: |
| 196 | # Not found in users.json, ask from console |
| 197 | import getpass |
| 198 | privatekey = getpass.getpass("Private key (input hidden):") |
| 199 | try: |
| 200 | succ = site.content_manager.sign(inner_path=inner_path, privatekey=privatekey, update_changed_files=True, remove_missing_optional=remove_missing_optional) |
| 201 | except Exception as err: |
| 202 | logging.error("Sign error: %s" % Debug.formatException(err)) |
| 203 | succ = False |
| 204 | if succ and publish: |
| 205 | self.sitePublish(address, inner_path=inner_path) |
| 206 | |
| 207 | def siteVerify(self, address): |
| 208 | import time |
no test coverage detected