diff --git a/source/text/sbasic/python/python_session.xhp b/source/text/sbasic/python/python_session.xhp
index 3d54a6ffe0..2a35081a35 100644
--- a/source/text/sbasic/python/python_session.xhp
+++ b/source/text/sbasic/python/python_session.xhp
@@ -28,7 +28,7 @@
Examples:
With Python shell.
>>> from <the_module> import Session
- >>> print(Session.SharedPythonScripts()) # class method
+ >>> print(Session.SharedPythonScripts()) # static method
>>> print(Session().UserName) # object property
>>> input(Session().UserProfile) # object property
From ... menu.
@@ -37,8 +37,8 @@
def demo_session():
import screen_io as ui
- ui.MsgBox(Session.Share(),title='Installation Share') # class method
- ui.Print(Session.SharedPythonScripts()) # class method
+ ui.MsgBox(Session.Share(),title='Installation Share') # static method
+ ui.Print(Session.SharedPythonScripts()) # static method
s = Session() # instance creation
ui.MsgBox(s.UserName,title='Hello') # object property
ui.Print(s.UserPythonScripts) # object property
@@ -76,31 +76,31 @@
class Session():
@staticmethod
def substitute(var_name):
- ctx = uno.getComponentContext()
- ps = ctx.getServiceManager().createInstanceWithContext(
- 'com.sun.star.util.PathSubstitution', ctx)
- return ps.getSubstituteVariableValue(var_name)
+ ctx = uno.getComponentContext()
+ ps = ctx.getServiceManager().createInstanceWithContext(
+ 'com.sun.star.util.PathSubstitution', ctx)
+ return ps.getSubstituteVariableValue(var_name)
@staticmethod
def Share():
- inst = uno.fileUrlToSystemPath(Session.substitute("$(prog)"))
- return os.path.normpath(inst.replace('program', "Share"))
+ inst = uno.fileUrlToSystemPath(Session.substitute("$(prog)"))
+ return os.path.normpath(inst.replace('program', "Share"))
@staticmethod
def SharedScripts():
- return ''.join([Session.Share(), os.sep, "Scripts"])
+ return ''.join([Session.Share(), os.sep, "Scripts"])
@staticmethod
def SharedPythonScripts():
- return ''.join([Session.SharedScripts(), os.sep, 'python'])
+ return ''.join([Session.SharedScripts(), os.sep, 'python'])
@property # alternative to '$(username)' variable
def UserName(self): return getpass.getuser()
@property
def UserProfile(self):
- return uno.fileUrlToSystemPath(Session.substitute("$(user)"))
+ return uno.fileUrlToSystemPath(Session.substitute("$(user)"))
@property
def UserScripts(self):
- return ''.join([self.UserProfile, os.sep, 'Scripts'])
+ return ''.join([self.UserProfile, os.sep, 'Scripts'])
@property
def UserPythonScripts(self):
- return ''.join([self.UserScripts, os.sep, "python"])
+ return ''.join([self.UserScripts, os.sep, "python"])
Unlike Basic, pathname normalization is performed with Python inside Session class.
%PRODUCTNAME Basic Session class:
@@ -148,12 +148,8 @@
End Property ' Session.userPythonScripts