@@ -57,18 +57,22 @@ def _IsGrammar3(context):
57
57
# ISO-8601 Dates
58
58
#===============================================================================
59
59
def GetISODate (context ):
60
+ # Migrated to java
60
61
return time .strftime ("%Y-%m-%d" )
61
62
62
63
def GetISODateString1 (context ):
64
+ # Migrated to java
63
65
return time .strftime ("%Y-%m-%d %H:%M" )
64
66
65
67
def GetISODateString2 (context ):
68
+ # Migrated to java
66
69
return time .strftime ("%Y-%m-%d %H:%M:%S" )
67
70
68
71
#===================================================================================================
69
72
# GetModuleName
70
73
#===================================================================================================
71
74
def GetModuleName (context ):
75
+ # Migrated to java
72
76
return context .getModuleName ()
73
77
74
78
@@ -79,6 +83,7 @@ def _GetCurrentASTPath(context, reverse=False):
79
83
'''
80
84
@return: ArrayList(SimpleNode)
81
85
'''
86
+ # Migrated to java
82
87
FastParser = context .getFastParserClass () # from org.python.pydev.parser.fastparser import FastParser
83
88
selection = _CreateSelection (context )
84
89
ret = FastParser .parseToKnowGloballyAccessiblePath (
@@ -94,6 +99,7 @@ def _GetCurrentASTPath(context, reverse=False):
94
99
# GetQualifiedNameScope
95
100
#===================================================================================================
96
101
def GetQualifiedNameScope (context ):
102
+ # Migrated to java
97
103
NodeUtils = context .getNodeUtilsClass () # from org.python.pydev.parser.visitors import NodeUtils
98
104
99
105
ret = ''
@@ -108,6 +114,7 @@ def GetQualifiedNameScope(context):
108
114
# _GetCurrentClassStmt
109
115
#===================================================================================================
110
116
def _GetCurrentClassStmt (context ):
117
+ # Migrated to java
111
118
NodeUtils = context .getNodeUtilsClass () #from org.python.pydev.parser.visitors import NodeUtils
112
119
ClassDef = context .getClassDefClass () # from org.python.pydev.parser.jython.ast import ClassDef
113
120
@@ -116,11 +123,11 @@ def _GetCurrentClassStmt(context):
116
123
return stmt
117
124
return None
118
125
119
-
120
126
#===================================================================================================
121
127
# GetCurrentClass
122
128
#===================================================================================================
123
129
def GetCurrentClass (context ):
130
+ # Migrated to java
124
131
NodeUtils = context .getNodeUtilsClass () #from org.python.pydev.parser.visitors import NodeUtils
125
132
ClassDef = context .getClassDefClass () # from org.python.pydev.parser.jython.ast import ClassDef
126
133
@@ -130,14 +137,11 @@ def GetCurrentClass(context):
130
137
131
138
return ''
132
139
133
-
134
- template_helper .AddTemplateVariable (py_context_type , 'current_class' , 'Current class' , GetCurrentClass )
135
-
136
-
137
140
#===================================================================================================
138
141
# GetSelfOrCls
139
142
#===================================================================================================
140
143
def GetSelfOrCls (context ):
144
+ # Migrated to java
141
145
FunctionDef = context .getFunctionDefClass () # from org.python.pydev.parser.jython.ast import ClassDef
142
146
143
147
FastParser = context .getFastParserClass () # from org.python.pydev.parser.fastparser import FastParser
@@ -151,36 +155,28 @@ def GetSelfOrCls(context):
151
155
152
156
return 'self'
153
157
154
- template_helper .AddTemplateVariable (py_context_type , 'self_or_cls' , 'Get `self` or `cls`' , GetSelfOrCls )
155
-
156
-
157
158
#===================================================================================================
158
159
# GetPydevdFileLocation
159
160
#===================================================================================================
160
161
def GetPydevdFileLocation (context ):
162
+ # Migrated to java
161
163
from org .python .pydev .debug .ui .launching import PythonRunnerConfig # @UnresolvedImport
162
164
return PythonRunnerConfig .getDebugScript ()
163
165
164
- template_helper .AddTemplateVariable (
165
- py_context_type , 'pydevd_file_location' , 'pydevd.py File Location' , GetPydevdFileLocation )
166
-
167
166
#===================================================================================================
168
167
# GetPydevdDirLocation
169
168
#===================================================================================================
170
169
def GetPydevdDirLocation (context ):
170
+ # Migrated to java
171
171
from org .python .pydev .debug .ui .launching import PythonRunnerConfig # @UnresolvedImport
172
172
import os
173
173
return os .path .split (PythonRunnerConfig .getDebugScript ())[0 ]
174
174
175
- template_helper .AddTemplateVariable (
176
- py_context_type , 'pydevd_dir_location' , 'pydevd.py Directory Location' , GetPydevdDirLocation )
177
-
178
-
179
-
180
175
#===================================================================================================
181
176
# GetCurrentMethod
182
177
#===================================================================================================
183
178
def GetCurrentMethod (context ):
179
+ # Migrated to java
184
180
NodeUtils = context .getNodeUtilsClass () #from org.python.pydev.parser.visitors import NodeUtils
185
181
FunctionDef = context .getFunctionDefClass () # from org.python.pydev.parser.jython.ast import FunctionDef
186
182
@@ -189,15 +185,11 @@ def GetCurrentMethod(context):
189
185
return NodeUtils .getRepresentationString (stmt )
190
186
return ''
191
187
192
-
193
-
194
- template_helper .AddTemplateVariable (py_context_type , 'current_method' , 'Current method' , GetCurrentMethod )
195
-
196
-
197
188
#===================================================================================================
198
189
# _GetPreviousOrNextClassOrMethod
199
190
#===================================================================================================
200
191
def _GetPreviousOrNextClassOrMethod (context , searchForward ):
192
+ # Migrated to java
201
193
NodeUtils = context .getNodeUtilsClass () #from org.python.pydev.parser.visitors import NodeUtils
202
194
FastParser = context .getFastParserClass () #from org.python.pydev.parser.fastparser import FastParser
203
195
doc = context .getDocument ()
@@ -215,26 +207,22 @@ def _GetPreviousOrNextClassOrMethod(context, searchForward):
215
207
# GetPreviousClassOrMethod
216
208
#===================================================================================================
217
209
def GetPreviousClassOrMethod (context ):
210
+ # Migrated to java
218
211
return _GetPreviousOrNextClassOrMethod (context , False )
219
212
220
- template_helper .AddTemplateVariable (
221
- py_context_type , 'prev_class_or_method' , 'Previous class or method' , GetPreviousClassOrMethod )
222
-
223
213
#===================================================================================================
224
214
# GetNextClassOrMethod
225
215
#===================================================================================================
226
216
def GetNextClassOrMethod (context ):
217
+ # Migrated to java
227
218
return _GetPreviousOrNextClassOrMethod (context , True )
228
219
229
- template_helper .AddTemplateVariable (
230
- py_context_type , 'next_class_or_method' , 'Next class or method' , GetNextClassOrMethod )
231
-
232
-
233
-
234
220
#===================================================================================================
235
221
# GetSuperclass
236
222
#===================================================================================================
237
223
def GetSuperclass (context ):
224
+ # Migrated to java
225
+
238
226
selection = _CreateSelection (context )
239
227
stmt = _GetCurrentClassStmt (context )
240
228
BadLocationException = context .getBadLocationExceptionClass () # from org.eclipse.jface.text import BadLocationException
@@ -283,6 +271,3 @@ def GetSuperclass(context):
283
271
return contents .strip ()
284
272
285
273
return ''
286
-
287
- template_helper .AddTemplateVariable (
288
- py_context_type , 'superclass' , 'Superclass of the current class' , GetSuperclass )
0 commit comments