Thu, 19 Nov 2020 17:41:58 +0100
UicLoadUi: added code to add the eric package directory so eric plugin development can access the eric specific GUI extensions.
6547
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

1  # * coding: utf8 * 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

2  
7360
9190402e4505
Updated copyright for 2020.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7357
diff
changeset

3  # Copyright (c) 2011  2020 Detlev Offenbach <detlev@dieoffenbachs.de> 
6547
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

4  # 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

5  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

6  """ 
7229
53054eb5b15a
Removed obsolete "from __future__ import ..." statements.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7198
diff
changeset

7  Module to get the object name, class name or signatures of a Qt form (*.ui). 
6547
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

8  """ 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

9  
7834
6ffe1fe2ab4a
UicLoadUi: added code to add the eric package directory so eric plugin development can access the eric specific GUI extensions.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7628
diff
changeset

10  import os 
6547
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

11  import sys 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

12  import json 
7628
f904d0eef264
Checked the reported security related issue reports generated by the new security checker.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7360
diff
changeset

13  import xml.etree.ElementTree # secok 
6547
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

14  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

15  try: 
7198
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

16  from PyQt5.QtCore import QMetaMethod, QByteArray 
6547
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

17  from PyQt5.QtWidgets import QAction, QWidget, QApplication 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

18  from PyQt5 import uic 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

19  except ImportError: 
7198
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

20  print("PyQt5 could not be found.") 
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

21  sys.exit(1) 
6547
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

22  
7357
fe4e06357f54
UicLoadUi: fixed an issue causing the code generation to fail for forms containing QtWebEngine widgets (see issue313)
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7266
diff
changeset

23  try: 
fe4e06357f54
UicLoadUi: fixed an issue causing the code generation to fail for forms containing QtWebEngine widgets (see issue313)
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7266
diff
changeset

24  from PyQt5 import QtWebEngineWidgets # __IGNORE_WARNING__ 
fe4e06357f54
UicLoadUi: fixed an issue causing the code generation to fail for forms containing QtWebEngine widgets (see issue313)
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7266
diff
changeset

25  except ImportError: 
fe4e06357f54
UicLoadUi: fixed an issue causing the code generation to fail for forms containing QtWebEngine widgets (see issue313)
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7266
diff
changeset

26  pass 
fe4e06357f54
UicLoadUi: fixed an issue causing the code generation to fail for forms containing QtWebEngine widgets (see issue313)
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7266
diff
changeset

27  
7834
6ffe1fe2ab4a
UicLoadUi: added code to add the eric package directory so eric plugin development can access the eric specific GUI extensions.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7628
diff
changeset

28  sys.path.append(os.path.dirname(os.path.dirname(__file__))) 
6ffe1fe2ab4a
UicLoadUi: added code to add the eric package directory so eric plugin development can access the eric specific GUI extensions.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7628
diff
changeset

29  # add the eric package directory 
6547
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

30  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

31  def objectName(formFile, projectPath): 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

32  """ 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

33  Function to get the object name of a form. 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

34  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

35  @param formFile file name of the form 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

36  @type str 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

37  @param projectPath directory name of the project 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

38  @type str 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

39  """ 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

40  app = QApplication([]) # __IGNORE_WARNING__ 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

41  try: 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

42  dlg = uic.loadUi(formFile, package=projectPath) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

43  print(dlg.objectName()) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

44  sys.exit(0) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

45  except (AttributeError, ImportError, 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

46  xml.etree.ElementTree.ParseError) as err: 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

47  print(str(err)) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

48  sys.exit(1) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

49  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

50  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

51  def className(formFile, projectPath): 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

52  """ 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

53  Function to get the class name of a form. 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

54  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

55  @param formFile file name of the form 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

56  @type str 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

57  @param projectPath directory name of the project 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

58  @type str 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

59  """ 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

60  app = QApplication([]) # __IGNORE_WARNING__ 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

61  try: 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

62  dlg = uic.loadUi(formFile, package=projectPath) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

63  print(dlg.metaObject().className()) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

64  sys.exit(0) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

65  except (AttributeError, ImportError, 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

66  xml.etree.ElementTree.ParseError) as err: 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

67  print(str(err)) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

68  sys.exit(1) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

69  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

70  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

71  def __mapType(type_): 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

72  """ 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

73  Private function to map a type as reported by Qt's meta object to the 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

74  correct Python type. 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

75  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

76  @param type_ type as reported by Qt 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

77  @type QByteArray or bytes 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

78  @return mapped Python type 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

79  @rtype str 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

80  """ 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

81  mapped = bytes(type_).decode() 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

82  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

83  # I. always check for * 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

84  mapped = mapped.replace("*", "") 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

85  
7198
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

86  # 1. check for const 
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

87  mapped = mapped.replace("const ", "") 
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

88  
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

89  # 2. replace QString and QStringList 
7265
0665c4d509c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7229
diff
changeset

90  mapped = ( 
0665c4d509c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7229
diff
changeset

91  mapped 
7266
d001bc703c29
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7265
diff
changeset

92  .replace("QStringList", "list") 
7265
0665c4d509c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7229
diff
changeset

93  .replace("QString", "str") 
0665c4d509c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7229
diff
changeset

94  ) 
7198
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

95  
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

96  # 3. replace double by float 
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

97  mapped = mapped.replace("double", "float") 
6547
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

98  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

99  return mapped 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

100  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

101  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

102  def signatures(formFile, projectPath): 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

103  """ 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

104  Function to get the signatures of form elements. 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

105  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

106  @param formFile file name of the form 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

107  @type str 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

108  @param projectPath directory name of the project 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

109  @type str 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

110  """ 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

111  objectsList = [] 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

112  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

113  app = QApplication([]) # __IGNORE_WARNING__ 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

114  try: 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

115  dlg = uic.loadUi(formFile, package=projectPath) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

116  objects = dlg.findChildren(QWidget) + dlg.findChildren(QAction) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

117  for obj in objects: 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

118  name = obj.objectName() 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

119  if not name or name.startswith("qt_"): 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

120  # ignore unnamed or internal objects 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

121  continue 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

122  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

123  metaObject = obj.metaObject() 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

124  objectDict = { 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

125  "name": name, 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

126  "class_name": metaObject.className(), 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

127  "methods": [], 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

128  } 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

129  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

130  for index in range(metaObject.methodCount()): 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

131  metaMethod = metaObject.method(index) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

132  if metaMethod.methodType() == QMetaMethod.Signal: 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

133  signatureDict = { 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

134  "methods": [] 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

135  } 
7198
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

136  signatureDict["signature"] = "on_{0}_{1}".format( 
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

137  name, 
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

138  bytes(metaMethod.methodSignature()).decode() 
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

139  ) 
6547
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

140  
7198
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

141  signatureDict["methods"].append("on_{0}_{1}".format( 
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

142  name, 
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

143  bytes(metaMethod.methodSignature()) 
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

144  .decode().split("(")[0] 
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

145  )) 
6547
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

146  signatureDict["methods"].append("{0}({1})".format( 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

147  signatureDict["methods"][1], 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

148  ", ".join([ 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

149  __mapType(t) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

150  for t in metaMethod.parameterTypes() 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

151  ]) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

152  )) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

153  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

154  returnType = __mapType( 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

155  metaMethod.typeName().encode()) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

156  if returnType == 'void': 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

157  returnType = "" 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

158  signatureDict["return_type"] = returnType 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

159  parameterTypesList = [ 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

160  __mapType(t) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

161  for t in metaMethod.parameterTypes() 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

162  ] 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

163  signatureDict["parameter_types"] = parameterTypesList 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

164  pyqtSignature = ", ".join(parameterTypesList) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

165  signatureDict["pyqt_signature"] = pyqtSignature 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

166  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

167  parameterNames = metaMethod.parameterNames() 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

168  if parameterNames: 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

169  for index in range(len(parameterNames)): 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

170  if not parameterNames[index]: 
7265
0665c4d509c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7229
diff
changeset

171  parameterNames[index] = QByteArray( 
0665c4d509c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7229
diff
changeset

172  "p{0:d}".format(index).encode("utf8") 
0665c4d509c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7229
diff
changeset

173  ) 
6547
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

174  parameterNamesList = [bytes(n).decode() 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

175  for n in parameterNames] 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

176  signatureDict["parameter_names"] = parameterNamesList 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

177  methNamesSig = ", ".join(parameterNamesList) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

178  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

179  if methNamesSig: 
7265
0665c4d509c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7229
diff
changeset

180  pythonSignature = "on_{0}_{1}(self, {2})".format( 
0665c4d509c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7229
diff
changeset

181  name, 
0665c4d509c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7229
diff
changeset

182  bytes(metaMethod.methodSignature()) 
0665c4d509c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7229
diff
changeset

183  .decode().split("(")[0], 
0665c4d509c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7229
diff
changeset

184  methNamesSig) 
7198
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

185  else: 
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

186  pythonSignature = "on_{0}_{1}(self)".format( 
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

187  name, 
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

188  bytes(metaMethod.methodSignature()) 
684261ef2165
Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
7192
diff
changeset

189  .decode().split("(")[0]) 
6547
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

190  signatureDict["python_signature"] = pythonSignature 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

191  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

192  objectDict["methods"].append(signatureDict) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

193  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

194  objectsList.append(objectDict) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

195  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

196  print(json.dumps(objectsList)) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

197  sys.exit(0) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

198  except (AttributeError, ImportError, 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

199  xml.etree.ElementTree.ParseError) as err: 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

200  print(str(err)) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

201  sys.exit(1) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

202  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

203  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

204  if __name__ == "__main__": 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

205  if len(sys.argv) != 4: 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

206  print("Wrong number of arguments.") 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

207  sys.exit(1) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

208  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

209  if sys.argv[1] == "object_name": 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

210  objectName(sys.argv[2], sys.argv[3]) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

211  elif sys.argv[1] == "class_name": 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

212  className(sys.argv[2], sys.argv[3]) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

213  elif sys.argv[1] == "signatures": 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

214  signatures(sys.argv[2], sys.argv[3]) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

215  else: 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

216  print("Unknow operation given.") 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

217  sys.exit(1) 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

218  
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

219  # 
77c817301ca1
CreateDialogCodeDialog: third attempt on getting this working with projects using a virtual environment different from the one used to run eric.
Detlev Offenbach <detlev@dieoffenbachs.de>
parents:
diff
changeset

220  # eflag: noqa = M701, M801 