ProjectDjango/Project.py

branch
eric7
changeset 195
b027b4f90994
parent 193
bf4c1a7833b4
child 197
2667e16a3379
equal deleted inserted replaced
194:f497097bb0aa 195:b027b4f90994
1250 Public method to create a new form. 1250 Public method to create a new form.
1251 1251
1252 @param path full directory path for the new form file 1252 @param path full directory path for the new form file
1253 @type str 1253 @type str
1254 """ 1254 """
1255 fileFilters = self.tr( 1255 fileFilters = self.tr("HTML Files (*.html);;HTML Files (*.htm);;All Files (*)")
1256 "HTML Files (*.html);;HTML Files (*.htm);;All Files (*)"
1257 )
1258 fname, selectedFilter = EricFileDialog.getSaveFileNameAndFilter( 1256 fname, selectedFilter = EricFileDialog.getSaveFileNameAndFilter(
1259 self.__ui, 1257 self.__ui,
1260 self.tr("New Form"), 1258 self.tr("New Form"),
1261 path, 1259 path,
1262 fileFilters, 1260 fileFilters,
1593 "{1}</a></td></tr>" 1591 "{1}</a></td></tr>"
1594 "</table></p>" 1592 "</table></p>"
1595 ).format(version, url), 1593 ).format(version, url),
1596 modal=True, 1594 modal=True,
1597 buttons=EricMessageBox.Ok, 1595 buttons=EricMessageBox.Ok,
1596 parent=self.__ui,
1598 ) 1597 )
1599 msgBox.setIconPixmap( 1598 msgBox.setIconPixmap(
1600 EricPixmapCache.getPixmap( 1599 EricPixmapCache.getPixmap(
1601 os.path.join( 1600 os.path.join(
1602 "ProjectDjango", "icons", "django64-{0}".format(self.__iconSuffix) 1601 "ProjectDjango", "icons", "django64-{0}".format(self.__iconSuffix)
1929 1928
1930 args.append("startproject") 1929 args.append("startproject")
1931 args.append(projectName) 1930 args.append(projectName)
1932 1931
1933 dia = DjangoDialog( 1932 dia = DjangoDialog(
1934 title, msgSuccess=self.tr("Django project created successfully.") 1933 title,
1934 msgSuccess=self.tr("Django project created successfully."),
1935 parent=self.__ui,
1935 ) 1936 )
1936 res = dia.startProcess(args, path) 1937 res = dia.startProcess(args, path)
1937 if res: 1938 if res:
1938 dia.exec() 1939 dia.exec()
1939 1940
2018 return False 2019 return False
2019 args.append("startapp") 2020 args.append("startapp")
2020 args.append(applName) 2021 args.append(applName)
2021 2022
2022 dia = DjangoDialog( 2023 dia = DjangoDialog(
2023 title, msgSuccess=self.tr("Django application created successfully.") 2024 title,
2025 msgSuccess=self.tr("Django application created successfully."),
2026 parent=self.__ui,
2024 ) 2027 )
2025 res = dia.startProcess(args, path) 2028 res = dia.startProcess(args, path)
2026 if res: 2029 if res:
2027 dia.exec() 2030 dia.exec()
2028 return res 2031 return res
2395 try: 2398 try:
2396 path = self.__sitePath() 2399 path = self.__sitePath()
2397 except DjangoNoSiteSelectedError: 2400 except DjangoNoSiteSelectedError:
2398 return 2401 return
2399 2402
2400 dia = DjangoDialog(title, fixed=True, linewrap=False) 2403 dia = DjangoDialog(title, fixed=True, linewrap=False, parent=self.__ui)
2401 res = dia.startProcess(args, path, False) 2404 res = dia.startProcess(args, path, False)
2402 if res: 2405 if res:
2403 dia.exec() 2406 dia.exec()
2404 2407
2405 def __databaseFlush(self): 2408 def __databaseFlush(self):
2427 args.append("--noinput") 2430 args.append("--noinput")
2428 if self.__currentDatabase: 2431 if self.__currentDatabase:
2429 args.append("--database={0}".format(self.__currentDatabase)) 2432 args.append("--database={0}".format(self.__currentDatabase))
2430 2433
2431 dia = DjangoDialog( 2434 dia = DjangoDialog(
2432 title, msgSuccess=self.tr("Database tables flushed successfully.") 2435 title,
2436 msgSuccess=self.tr("Database tables flushed successfully."),
2437 parent=self.__ui,
2433 ) 2438 )
2434 res = dia.startProcess(args, path) 2439 res = dia.startProcess(args, path)
2435 if res: 2440 if res:
2436 dia.exec() 2441 dia.exec()
2437 2442
2497 args.append("--database={0}".format(self.__currentDatabase)) 2502 args.append("--database={0}".format(self.__currentDatabase))
2498 args += apps 2503 args += apps
2499 2504
2500 fileFilter = self.tr("SQL Files (*.sql)") 2505 fileFilter = self.tr("SQL Files (*.sql)")
2501 2506
2502 dia = DjangoDialog(title, fixed=True, linewrap=False, saveFilters=fileFilter) 2507 dia = DjangoDialog(
2508 title, fixed=True, linewrap=False, saveFilters=fileFilter, parent=self.__ui
2509 )
2503 res = dia.startProcess(args, path, False) 2510 res = dia.startProcess(args, path, False)
2504 if res: 2511 if res:
2505 dia.exec() 2512 dia.exec()
2506 2513
2507 def __databaseSqlFlushDatabase(self): 2514 def __databaseSqlFlushDatabase(self):
2542 return 2549 return
2543 2550
2544 title = self.tr("SQL Migrate") 2551 title = self.tr("SQL Migrate")
2545 2552
2546 dlg = DjangoMigrationSelectionDialog( 2553 dlg = DjangoMigrationSelectionDialog(
2547 migrations, migrationRequired=True, suffix=self.__iconSuffix 2554 migrations,
2555 migrationRequired=True,
2556 suffix=self.__iconSuffix,
2557 parent=self.__ui,
2548 ) 2558 )
2549 if dlg.exec() == QDialog.DialogCode.Accepted: 2559 if dlg.exec() == QDialog.DialogCode.Accepted:
2550 app, migration = dlg.getData() 2560 app, migration = dlg.getData()
2551 2561
2552 args = [] 2562 args = []
2561 args.append(migration) 2571 args.append(migration)
2562 2572
2563 fileFilter = self.tr("SQL Files (*.sql)") 2573 fileFilter = self.tr("SQL Files (*.sql)")
2564 2574
2565 dia = DjangoDialog( 2575 dia = DjangoDialog(
2566 title, fixed=True, linewrap=False, saveFilters=fileFilter 2576 title,
2577 fixed=True,
2578 linewrap=False,
2579 saveFilters=fileFilter,
2580 parent=self.__ui,
2567 ) 2581 )
2568 res = dia.startProcess(args, path, False) 2582 res = dia.startProcess(args, path, False)
2569 if res: 2583 if res:
2570 dia.exec() 2584 dia.exec()
2571 2585
2630 self.tr("Apply Selected Migrations"), 2644 self.tr("Apply Selected Migrations"),
2631 self.tr("""No migrations available."""), 2645 self.tr("""No migrations available."""),
2632 ) 2646 )
2633 return 2647 return
2634 2648
2635 dlg = DjangoMigrationSelectionDialog(migrations, suffix=self.__iconSuffix) 2649 dlg = DjangoMigrationSelectionDialog(
2650 migrations, suffix=self.__iconSuffix, parent=self.__ui
2651 )
2636 if dlg.exec() == QDialog.DialogCode.Accepted: 2652 if dlg.exec() == QDialog.DialogCode.Accepted:
2637 app, migration = dlg.getData() 2653 app, migration = dlg.getData()
2638 self.applyMigrations(app=app, migration=migration) 2654 self.applyMigrations(app=app, migration=migration)
2639 2655
2640 def applyMigrations(self, app=None, migration=None): 2656 def applyMigrations(self, app=None, migration=None):
2665 if app: 2681 if app:
2666 args.append(app) 2682 args.append(app)
2667 if migration: 2683 if migration:
2668 args.append(migration) 2684 args.append(migration)
2669 2685
2670 dia = DjangoDialog(title) 2686 dia = DjangoDialog(title, parent=self.__ui)
2671 res = dia.startProcess(args, path) 2687 res = dia.startProcess(args, path)
2672 if res: 2688 if res:
2673 dia.exec() 2689 dia.exec()
2674 2690
2675 def __unapplyMigrations(self): 2691 def __unapplyMigrations(self):
2747 """ 2763 """
2748 Private slot to generate migrations for the Django project. 2764 Private slot to generate migrations for the Django project.
2749 """ 2765 """
2750 from .DjangoMakeMigrationsDialog import DjangoMakeMigrationsDialog 2766 from .DjangoMakeMigrationsDialog import DjangoMakeMigrationsDialog
2751 2767
2752 dlg = DjangoMakeMigrationsDialog(self.getRecentApplications()) 2768 dlg = DjangoMakeMigrationsDialog(self.getRecentApplications(), parent=self.__ui)
2753 if dlg.exec() == QDialog.DialogCode.Accepted: 2769 if dlg.exec() == QDialog.DialogCode.Accepted:
2754 apps, migration, dryRun, empty, merge = dlg.getData() 2770 apps, migration, dryRun, empty, merge = dlg.getData()
2755 if apps: 2771 if apps:
2756 self.setMostRecentApplication(apps) 2772 self.setMostRecentApplication(apps)
2757 apps = apps.split() 2773 apps = apps.split()
2795 if merge: 2811 if merge:
2796 args.append("--merge") 2812 args.append("--merge")
2797 if apps: 2813 if apps:
2798 args += apps 2814 args += apps
2799 2815
2800 dia = DjangoDialog(title, showInput=True) 2816 dia = DjangoDialog(title, showInput=True, parent=self.__ui)
2801 res = dia.startProcess(args, path) 2817 res = dia.startProcess(args, path)
2802 if res: 2818 if res:
2803 dia.exec() 2819 dia.exec()
2804 2820
2805 def __squashMigrations(self): 2821 def __squashMigrations(self):
2817 self.tr("Squash Migrations"), 2833 self.tr("Squash Migrations"),
2818 self.tr("""No migrations available."""), 2834 self.tr("""No migrations available."""),
2819 ) 2835 )
2820 return 2836 return
2821 2837
2822 dlg = DjangoSquashMigrationSelectionDialog(migrations, self, self.__iconSuffix) 2838 dlg = DjangoSquashMigrationSelectionDialog(
2839 migrations, self, self.__iconSuffix, parent=self.__ui
2840 )
2823 if dlg.exec() == QDialog.DialogCode.Accepted: 2841 if dlg.exec() == QDialog.DialogCode.Accepted:
2824 app, start, end, noOptimize, name = dlg.getData() 2842 app, start, end, noOptimize, name = dlg.getData()
2825 2843
2826 title = self.tr("Squash Migrations") 2844 title = self.tr("Squash Migrations")
2827 2845
2842 args.append(app) 2860 args.append(app)
2843 if start: 2861 if start:
2844 args.append(start) 2862 args.append(start)
2845 args.append(end) 2863 args.append(end)
2846 2864
2847 dia = DjangoDialog(title) 2865 dia = DjangoDialog(title, parent=self.__ui)
2848 res = dia.startProcess(args, path) 2866 res = dia.startProcess(args, path)
2849 if res: 2867 if res:
2850 dia.exec() 2868 dia.exec()
2851 2869
2852 ################################################################## 2870 ##################################################################
2859 """ 2877 """
2860 from .DjangoDiffsettingsDataDialog import DjangoDiffsettingsDataDialog 2878 from .DjangoDiffsettingsDataDialog import DjangoDiffsettingsDataDialog
2861 2879
2862 title = self.tr("Diff Settings") 2880 title = self.tr("Diff Settings")
2863 2881
2864 dlg = DjangoDiffsettingsDataDialog(self, self.__ui) 2882 dlg = DjangoDiffsettingsDataDialog(self, parent=self.__ui)
2865 if dlg.exec() == QDialog.DialogCode.Accepted: 2883 if dlg.exec() == QDialog.DialogCode.Accepted:
2866 showAll, defaultModule, outputFormat = dlg.getData() 2884 showAll, defaultModule, outputFormat = dlg.getData()
2867 2885
2868 args = [] 2886 args = []
2869 args.append(self.__getPythonExecutable()) 2887 args.append(self.__getPythonExecutable())
2879 try: 2897 try:
2880 path = self.__sitePath() 2898 path = self.__sitePath()
2881 except DjangoNoSiteSelectedError: 2899 except DjangoNoSiteSelectedError:
2882 return 2900 return
2883 2901
2884 dia = DjangoDialog(title, fixed=True, linewrap=False) 2902 dia = DjangoDialog(title, fixed=True, linewrap=False, parent=self.__ui)
2885 res = dia.startProcess(args, path, False) 2903 res = dia.startProcess(args, path, False)
2886 if res: 2904 if res:
2887 dia.exec() 2905 dia.exec()
2888 2906
2889 def __runPythonShell(self): 2907 def __runPythonShell(self):
2921 """ 2939 """
2922 from .DjangoSendTestEmailDataDialog import DjangoSendTestEmailDataDialog 2940 from .DjangoSendTestEmailDataDialog import DjangoSendTestEmailDataDialog
2923 2941
2924 title = self.tr("Send Test Email") 2942 title = self.tr("Send Test Email")
2925 2943
2926 dlg = DjangoSendTestEmailDataDialog(self.__ui) 2944 dlg = DjangoSendTestEmailDataDialog(parent=self.__ui)
2927 if dlg.exec() == QDialog.DialogCode.Accepted: 2945 if dlg.exec() == QDialog.DialogCode.Accepted:
2928 managers, admins, recipients = dlg.getData() 2946 managers, admins, recipients = dlg.getData()
2929 2947
2930 args = [] 2948 args = []
2931 args.append(self.__getPythonExecutable()) 2949 args.append(self.__getPythonExecutable())
2945 dia = DjangoDialog( 2963 dia = DjangoDialog(
2946 title, 2964 title,
2947 linewrap=False, 2965 linewrap=False,
2948 msgSuccess=self.tr("Test Email sent successfully."), 2966 msgSuccess=self.tr("Test Email sent successfully."),
2949 msgError=self.tr("Test Email could not be sent."), 2967 msgError=self.tr("Test Email could not be sent."),
2968 parent=self.__ui,
2950 ) 2969 )
2951 res = dia.startProcess(args, path, False) 2970 res = dia.startProcess(args, path, False)
2952 if res: 2971 if res:
2953 dia.exec() 2972 dia.exec()
2954 2973
2973 args.append("createcachetable") 2992 args.append("createcachetable")
2974 if self.__currentDatabase: 2993 if self.__currentDatabase:
2975 args.append("--database={0}".format(self.__currentDatabase)) 2994 args.append("--database={0}".format(self.__currentDatabase))
2976 2995
2977 dia = DjangoDialog( 2996 dia = DjangoDialog(
2978 title, msgSuccess=self.tr("Cache tables created successfully.") 2997 title,
2998 msgSuccess=self.tr("Cache tables created successfully."),
2999 parent=self.__ui,
2979 ) 3000 )
2980 res = dia.startProcess(args, wd) 3001 res = dia.startProcess(args, wd)
2981 if res: 3002 if res:
2982 dia.exec() 3003 dia.exec()
2983 3004
2996 try: 3017 try:
2997 wd = self.__sitePath() 3018 wd = self.__sitePath()
2998 except DjangoNoSiteSelectedError: 3019 except DjangoNoSiteSelectedError:
2999 return 3020 return
3000 3021
3001 dlg = DjangoDumpdataDataDialog(self, self.__ui) 3022 dlg = DjangoDumpdataDataDialog(self, parent=self.__ui)
3002 if dlg.exec() == QDialog.DialogCode.Accepted: 3023 if dlg.exec() == QDialog.DialogCode.Accepted:
3003 appls, excls, dumpFormat, indent = dlg.getData() 3024 appls, excls, dumpFormat, indent = dlg.getData()
3004 3025
3005 args = [] 3026 args = []
3006 args.append(self.__getPythonExecutable()) 3027 args.append(self.__getPythonExecutable())
3020 fileFilters = self.tr("XML Files (*.xml)") 3041 fileFilters = self.tr("XML Files (*.xml)")
3021 elif dumpFormat == "yaml": 3042 elif dumpFormat == "yaml":
3022 fileFilters = self.tr("YAML Files (*.yaml)") 3043 fileFilters = self.tr("YAML Files (*.yaml)")
3023 3044
3024 dia = DjangoDialog( 3045 dia = DjangoDialog(
3025 title, fixed=True, linewrap=False, saveFilters=fileFilters 3046 title,
3047 fixed=True,
3048 linewrap=False,
3049 saveFilters=fileFilters,
3050 parent=self.__ui,
3026 ) 3051 )
3027 res = dia.startProcess(args, wd, showCommand=False) 3052 res = dia.startProcess(args, wd, showCommand=False)
3028 if res: 3053 if res:
3029 dia.exec() 3054 dia.exec()
3030 3055
3039 try: 3064 try:
3040 wd = self.__sitePath() 3065 wd = self.__sitePath()
3041 except DjangoNoSiteSelectedError: 3066 except DjangoNoSiteSelectedError:
3042 return 3067 return
3043 3068
3044 dlg = DjangoLoaddataDataDialog(self, self.__ui) 3069 dlg = DjangoLoaddataDataDialog(self, parent=self.__ui)
3045 if dlg.exec() == QDialog.DialogCode.Accepted: 3070 if dlg.exec() == QDialog.DialogCode.Accepted:
3046 fixtures, excludes, appLabel, ignore = dlg.getData() 3071 fixtures, excludes, appLabel, ignore = dlg.getData()
3047 3072
3048 args = [] 3073 args = []
3049 args.append(self.__getPythonExecutable()) 3074 args.append(self.__getPythonExecutable())
3057 args.append("--app={0}".format(appLabel)) 3082 args.append("--app={0}".format(appLabel))
3058 if self.__currentDatabase: 3083 if self.__currentDatabase:
3059 args.append("--database={0}".format(self.__currentDatabase)) 3084 args.append("--database={0}".format(self.__currentDatabase))
3060 args += fixtures 3085 args += fixtures
3061 3086
3062 dia = DjangoDialog(title) 3087 dia = DjangoDialog(title, parent=self.__ui)
3063 res = dia.startProcess(args, wd) 3088 res = dia.startProcess(args, wd)
3064 if res: 3089 if res:
3065 dia.exec() 3090 dia.exec()
3066 3091
3067 def __runTestSuite(self, deprecation=False): 3092 def __runTestSuite(self, deprecation=False):
3081 wd = self.__sitePath() 3106 wd = self.__sitePath()
3082 except DjangoNoSiteSelectedError: 3107 except DjangoNoSiteSelectedError:
3083 return 3108 return
3084 3109
3085 dlg = DjangoTestDataDialog( 3110 dlg = DjangoTestDataDialog(
3086 self, self.__plugin.getPreferences("KeepTestDatabase"), self.__ui 3111 self, self.__plugin.getPreferences("KeepTestDatabase"), parent=self.__ui
3087 ) 3112 )
3088 if dlg.exec() == QDialog.DialogCode.Accepted: 3113 if dlg.exec() == QDialog.DialogCode.Accepted:
3089 labels, pattern, tags, excludeTags, keep, reverse = dlg.getData() 3114 labels, pattern, tags, excludeTags, keep, reverse = dlg.getData()
3090 3115
3091 self.__plugin.setPreferences("KeepTestDatabase", keep) 3116 self.__plugin.setPreferences("KeepTestDatabase", keep)
3127 3152
3128 consoleCmd = self.__isSpawningConsole( 3153 consoleCmd = self.__isSpawningConsole(
3129 self.__plugin.getPreferences("ConsoleCommand") 3154 self.__plugin.getPreferences("ConsoleCommand")
3130 )[1] 3155 )[1]
3131 if consoleCmd: 3156 if consoleCmd:
3132 dlg = DjangoRunTestServerDataDialog(self, self.__ui) 3157 dlg = DjangoRunTestServerDataDialog(self, parent=self.__ui)
3133 if dlg.exec() == QDialog.DialogCode.Accepted: 3158 if dlg.exec() == QDialog.DialogCode.Accepted:
3134 fixtures = dlg.getData() 3159 fixtures = dlg.getData()
3135 3160
3136 args = Utilities.parseOptionString(consoleCmd) 3161 args = Utilities.parseOptionString(consoleCmd)
3137 args[0] = getExecutablePath(args[0]) 3162 args[0] = getExecutablePath(args[0])
3260 args.append(self.__getPythonExecutable()) 3285 args.append(self.__getPythonExecutable())
3261 args.append("manage.py") 3286 args.append("manage.py")
3262 args.append("clearsessions") 3287 args.append("clearsessions")
3263 3288
3264 dia = DjangoDialog( 3289 dia = DjangoDialog(
3265 title, msgSuccess=self.tr("Expired sessions cleared successfully.") 3290 title,
3291 msgSuccess=self.tr("Expired sessions cleared successfully."),
3292 parent=self.__ui,
3266 ) 3293 )
3267 res = dia.startProcess(args, wd) 3294 res = dia.startProcess(args, wd)
3268 if res: 3295 if res:
3269 dia.exec() 3296 dia.exec()
3270 3297
3355 self.tr("No current site selected or no site created yet. Aborting..."), 3382 self.tr("No current site selected or no site created yet. Aborting..."),
3356 ) 3383 )
3357 return 3384 return
3358 3385
3359 dia = DjangoDialog( 3386 dia = DjangoDialog(
3360 title, msgSuccess=self.tr("\nMessage catalog initialized successfully.") 3387 title,
3388 msgSuccess=self.tr("\nMessage catalog initialized successfully."),
3389 parent=self.__ui,
3361 ) 3390 )
3362 res = dia.startProcess(args, wd) 3391 res = dia.startProcess(args, wd)
3363 if res: 3392 if res:
3364 dia.exec() 3393 dia.exec()
3365 3394
3405 None, title, self.tr("No locales detected. Aborting...") 3434 None, title, self.tr("No locales detected. Aborting...")
3406 ) 3435 )
3407 return 3436 return
3408 3437
3409 dia = DjangoDialog( 3438 dia = DjangoDialog(
3410 title, msgSuccess=self.tr("\nMessage catalogs updated successfully.") 3439 title,
3440 msgSuccess=self.tr("\nMessage catalogs updated successfully."),
3441 parent=self.__ui,
3411 ) 3442 )
3412 res = dia.startBatchProcesses(argsLists, wd) 3443 res = dia.startBatchProcesses(argsLists, wd)
3413 if res: 3444 if res:
3414 dia.exec() 3445 dia.exec()
3415 3446
3449 None, title, self.tr("No locales detected. Aborting...") 3480 None, title, self.tr("No locales detected. Aborting...")
3450 ) 3481 )
3451 return 3482 return
3452 3483
3453 dia = DjangoDialog( 3484 dia = DjangoDialog(
3454 title, msgSuccess=self.tr("\nMessage catalogs updated successfully.") 3485 title,
3486 msgSuccess=self.tr("\nMessage catalogs updated successfully."),
3487 parent=self.__ui,
3455 ) 3488 )
3456 res = dia.startBatchProcesses(argsLists, wd) 3489 res = dia.startBatchProcesses(argsLists, wd)
3457 if res: 3490 if res:
3458 dia.exec() 3491 dia.exec()
3459 3492
3482 self.tr("No current site selected or no site created yet. Aborting..."), 3515 self.tr("No current site selected or no site created yet. Aborting..."),
3483 ) 3516 )
3484 return 3517 return
3485 3518
3486 dia = DjangoDialog( 3519 dia = DjangoDialog(
3487 title, msgSuccess=self.tr("\nMessage catalogs updated successfully.") 3520 title,
3521 msgSuccess=self.tr("\nMessage catalogs updated successfully."),
3522 parent=self.__ui,
3488 ) 3523 )
3489 res = dia.startProcess(args, wd) 3524 res = dia.startProcess(args, wd)
3490 if res: 3525 if res:
3491 dia.exec() 3526 dia.exec()
3492 3527
3514 self.tr("No current site selected or no site created yet. Aborting..."), 3549 self.tr("No current site selected or no site created yet. Aborting..."),
3515 ) 3550 )
3516 return 3551 return
3517 3552
3518 dia = DjangoDialog( 3553 dia = DjangoDialog(
3519 title, msgSuccess=self.tr("\nMessage catalogs updated successfully.") 3554 title,
3555 msgSuccess=self.tr("\nMessage catalogs updated successfully."),
3556 parent=self.__ui,
3520 ) 3557 )
3521 res = dia.startProcess(args, wd) 3558 res = dia.startProcess(args, wd)
3522 if res: 3559 if res:
3523 dia.exec() 3560 dia.exec()
3524 3561
3560 None, title, self.tr("No locales detected. Aborting...") 3597 None, title, self.tr("No locales detected. Aborting...")
3561 ) 3598 )
3562 return 3599 return
3563 3600
3564 dia = DjangoDialog( 3601 dia = DjangoDialog(
3565 title, msgSuccess=self.tr("\nMessage catalogs compiled successfully.") 3602 title,
3603 msgSuccess=self.tr("\nMessage catalogs compiled successfully."),
3604 parent=self.__ui,
3566 ) 3605 )
3567 res = dia.startBatchProcesses(argsLists, wd, mergedOutput=True) 3606 res = dia.startBatchProcesses(argsLists, wd, mergedOutput=True)
3568 if res: 3607 if res:
3569 dia.exec() 3608 dia.exec()
3570 3609
3599 self.tr("No current site selected or no site created yet. Aborting..."), 3638 self.tr("No current site selected or no site created yet. Aborting..."),
3600 ) 3639 )
3601 return 3640 return
3602 3641
3603 dia = DjangoDialog( 3642 dia = DjangoDialog(
3604 title, msgSuccess=self.tr("\nMessage catalogs compiled successfully.") 3643 title,
3644 msgSuccess=self.tr("\nMessage catalogs compiled successfully."),
3645 parent=self.__ui,
3605 ) 3646 )
3606 res = dia.startProcess(args, wd, mergedOutput=True) 3647 res = dia.startProcess(args, wd, mergedOutput=True)
3607 if res: 3648 if res:
3608 dia.exec() 3649 dia.exec()
3609 3650
3654 dlg = DjangoCheckOptionsDialog( 3695 dlg = DjangoCheckOptionsDialog(
3655 self.__getPythonExecutable(), 3696 self.__getPythonExecutable(),
3656 path, 3697 path,
3657 self.getRecentApplications(), 3698 self.getRecentApplications(),
3658 self.__plugin.getPreferences("CheckDeployMode"), 3699 self.__plugin.getPreferences("CheckDeployMode"),
3700 parent=self.__ui,
3659 ) 3701 )
3660 if dlg.exec() == QDialog.DialogCode.Accepted: 3702 if dlg.exec() == QDialog.DialogCode.Accepted:
3661 deploy, tags, appsStr, settingsFile = dlg.getData() 3703 deploy, tags, appsStr, settingsFile = dlg.getData()
3662 self.__plugin.setPreferences("CheckDeployMode", deploy) 3704 self.__plugin.setPreferences("CheckDeployMode", deploy)
3663 if appsStr != "": 3705 if appsStr != "":
3675 args.append("--deploy") 3717 args.append("--deploy")
3676 if settingsFile: 3718 if settingsFile:
3677 args.append("--settings={0}".format(settingsFile)) 3719 args.append("--settings={0}".format(settingsFile))
3678 args += apps 3720 args += apps
3679 3721
3680 dia = DjangoDialog(self.tr("Check Project")) 3722 dia = DjangoDialog(self.tr("Check Project"), parent=self.__ui)
3681 res = dia.startProcess(args, path, mergedOutput=True) 3723 res = dia.startProcess(args, path, mergedOutput=True)
3682 if res: 3724 if res:
3683 dia.exec() 3725 dia.exec()

eric ide

mercurial