User bio
404 bio not found
Hamburg
Member since Jan 28, 2021
Posts:
Replies:
Hi Guillaume,
I have been using embedded Python for a while and have found that the hybrid between ObjectScript and python code is not always easy to maintain and refactor.
That's why I have now consistently outsourced the python code to .py files and imported my modules via
##class(%SYS.Python).Import("mymodule")
after reading your post. So far I'm very happy with how things are going, except I've had problems when applying the pythonic naming conventions for method names.
def validate_header():
caused errors when I tried to call it this way:
$$$ThrowOnError(mymodule.validate_header())
I had to rename the method to
def validateHeader():
which isn't particularly bad, but
And here is the code if you are using a Installer manifest 😉 Helps us while working with containers.
<Namespace Name="${NamespaceSub}" Code="${NamespaceSub}_CODE" Data="${NamespaceSub}_DATA" Create="yes" Ensemble="1">
...
<Invoke Class="HBT.Util.WebApp" Method="DisableNewRuleEditor" CheckStatus="1"></Invoke>
</Namespace>
Class HBT.Util.WebApp
{
ClassMethod DisableNewRuleEditor() As %Status
{
#Dim tSC As %Status
#Dim tSE As %Exception.StatusException
Try {
Zn "%SYS"
&SQL(UPDATE Security.Applications SET Enabled = 0 WHERE ID = '/ui/interop/rule-editor')
Set tSC = $$$OK
} Catch tSE {
Set tSC = tSE.AsStatus()
Quit
}
Quit tSC
}
}
Open Exchange applications:
Certifications & Credly badges:
Tommy has no Certifications & Credly badges yet.
Global Masters badges:
![Popular writer](https://community.intersystems.com/sites/default/files/badges/poular_writer.png)
![DC Author](https://community.intersystems.com/sites/default/files/badges/dc_author_0.png)
![DC Commenter](https://community.intersystems.com/sites/default/files/badges/dc_commenter_1.png)
![DC Problem Solver](https://community.intersystems.com/sites/default/files/badges/dc_problem_solver_1.png)
![InterSystems Researcher](https://community.intersystems.com/sites/default/files/badges/researcher.png)
![Bronze Commenter](https://community.intersystems.com/sites/default/files/badges/295959100-c193c40f-0952-4935-bea7-4317f796fbb7_0.png)
Followers:
Tommy has no followers yet.
Following:
😀 Thanks.