58 Commits

Author SHA1 Message Date
Dmitry Gribenchuk
8116df6c21
cleanup unused import and fix comment space 2023-12-13 20:10:28 +02:00
Jaime van Kessel
00078fd659
Remove a bunch of unused imports 2019-11-08 13:38:42 +01:00
Ghostkeeper
ae2b312472
Add typing for all version upgrade plug-ins
Hopefully we'll take this typing along when we next copy-paste the stuffs.

Contributes to issue CURA-5936.
2018-11-14 13:41:23 +01:00
Diego Prado Gesto
b309e93767 CURA-5330 Fix typing in the VersionUpgrade plugin 2018-06-14 16:54:22 +02:00
Lipu Fei
7de43e71e0 Fix legacy profile upgrade
CURA-4075

Only for single-extrusion machines just like before.
2017-12-01 11:06:14 +01:00
Mark
9a193ad5c5 Changing AGPLv3 to LGPLv3 2017-09-28 13:00:43 +02:00
Simon Edwards
4ab6b74930 Fixed a bunch of error which were reported by PyCharm's code analysis. 2017-02-26 21:05:09 +01:00
Simon Edwards
cf85831d87 Also check the upgrade plugins. 2017-01-17 20:56:28 +01:00
Simon Edwards
98a6568313 Merge branch 'master' into python_type_hinting 2016-11-22 11:15:04 +01:00
Simon Edwards
14afd9eab7 Heaps to changes to get the Cura code through the type checker (with minimal checking).
CURA-2917
2016-11-21 21:36:08 +01:00
Jaime van Kessel
1a2138de5a Moved warning to VersionUpgradeManager
CURA-2883
2016-11-21 11:21:20 +01:00
Jaime van Kessel
ac708d54b6 Importing invalid filetypes now gives proper error messages
CURA-2883
2016-11-18 16:46:54 +01:00
Ghostkeeper
2d41a992f1
Remove splitting profiles for each material
The material is no longer listed in the profiles and no longer filtered for, so we don't need to create a new profile for each material.

Contributes to issues CURA-844 and CURA-2320.
2016-10-06 11:41:39 +02:00
Ghostkeeper
7d57e90260
Remove debug statements
Oops.

Contributes to issue CURA-844.
2016-09-29 13:24:15 +02:00
Ghostkeeper
d29c817289
Actually apply translated settings
Don't know when this changed or why it hasn't propped up until then...

Contributes to issue CURA-844.
2016-09-29 11:56:46 +02:00
Ghostkeeper
4ec380ffd9
Quality-changes now have a quality_type instead of referring to quality
This field was just renamed, I think for CURA-2320. This updates the name for the upgrade process.

Contributes to issue CURA-844.
2016-09-27 15:12:29 +02:00
Ghostkeeper
5c49adc52e
Also return tuple if upgrading failed
It is checked if the file data is None or empty (the upgrade is then considered 'failed'). But to unpack the file data, it needs to be a tuple.

Contributes to issue CURA-844.
2016-09-14 15:41:32 +02:00
Ghostkeeper
89fb92edbd
Disable upgrading current settings altogether
The current settings in 2.1 specified a machine instance. In 2.2 they specify a machine definition. There is not enough information in one file to be able to translate that.

Contributes to issue CURA-844.
2016-09-13 14:58:13 +02:00
Ghostkeeper
93cd5acbad
Set quality to normal, not quality type
Even though this key says it's quality, it's not a quality profile, it's a quality type.

Contributes to issue CURA-844.
2016-09-08 19:23:18 +02:00
Ghostkeeper
761aeb1aa2
Always set type to quality_changes
Custom profiles are always quality changes. They should always say quality in the original anyway; that was an assumption we've made thousands of times.

Contributes to issue CURA-844.
2016-09-08 19:23:18 +02:00
Ghostkeeper
23180d408c
Always set quality type to normal
We don't know the actual quality type, the quality profile that this profile is based on. Maybe there isn't one, even. As a solution we always base imported custom quality profiles on normal.

Contributes to issue CURA-844.
2016-09-08 19:23:18 +02:00
fieldOfView
86ad1777af Fix setting weight of upgraded profile
self._weight sometimes becomes an int, and ConfigParser does not like ints.
2016-08-23 13:54:03 +02:00
Ghostkeeper
a0df0c76de
Use correct material profile in extruder stack
The material profile is more specific inside a material profile if the machine has material quality profiles.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
4d13622a6e
Split profiles also per variant
But of course the variant names are strange in the new material profiles.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
9c7a28fa2d
Don't break if current settings machine is unknown
Currently it sets the user profile to 'empty', which is bad because empty is read-only. But it allows me to continue for now. I'll find a solution for that later.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
36b027b290
Fix copying ConfigParser
Turns out that copy.copy() doesn't work on ConfigParsers. It returns a different instance but modifying that instance still modifies the old configs. Deep copy isn't allowed. But this dictionary copy works.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
71505a8b35
Use normal config only if not material(-specific) profile
Other profiles should just return an array with only their single profile.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
9a555fcab0
Fix call to VersionUpgrade21to22.machinesWithMachineQuality
It needs that stupidly long path if we're using imports inside a plug-in.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
1428f67798
Rename machines_with_machine_quality to machinesWithMachineQuality
As per the code style conventions. Sorry, I'm used to other conventions in one of my own projects.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
36f84017cf
Move _machines_with_machine_quality to VersionUpgrade21to22
It's going to need to be used by the upgrader of machine instances as well, that's why.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
7481f0802e
Split profiles into multiple if new printer has material profiles
If the old profile didn't specify any material, it would be global. But if the new machine specifies that its profiles are material-specific, these profiles have to be split into multiple profiles in order to be able to show them in Cura 2.2.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
af86375ba3
Output arrays of files rather than a single file
This is needed because the version upgrade system now allows for a version upgrader to output any number of files.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
8f5e56c66e
Make documentation specify filename without extension
Contributes to issue CURA-844.
2016-07-07 15:22:27 +02:00
Ghostkeeper
e6efba3868
Make version upgrade also translate file names
This was required since Cura 2.1 produced files with the same filename (bar extension). This then resulted in two containers with the same ID. If you had bad luck, an instance container was chosen as global container (depending on which was first in the unordered dictionary). This gives the current settings the postfix _current_settings, fixing that issue.

Contributes to issue CURA-844.
2016-07-07 15:13:58 +02:00
Ghostkeeper
19b4ec655e Move some things to metadata section
Why there is a difference between 'general' and 'metadata', only His Noodleness knows. Also put in a default for the type. It should apparently be 'quality' unless it is a user profile.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
8f34186a9b Rename settings section to values
It should be called 'values' in the new version.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
b841738b76 Translate variants in profile
Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
f13db7de10 Make translatePrinter use dict
A translation dictionary makes it much easier to edit the translations. Also this now just translates one printer, instead of a list.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
b5efb2eee8 Make profile translation use new translateSettingName
Forgot about this one.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
39212a601e Fix import
Didn't see this due to the sea of errors that it gives.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
a87e756a42 Translate machine names
Some names might be changed. I know of at least one: ultimaker2plus -> ultimaker2_plus.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
7f5b656c68 Update translation of metadata
A few fields are different now.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
07b6507133 Fix calls to translateSettings and translateSettingNames
They are one module deeper, due to the way that plug-ins are imported by Uranium.

Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
24946d3f13 Fix references to exception classes
These were moved to VersionUpgrade module.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
6572d939bf Convert for+if to list comprehension
It's a simple filter, so why not?

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
f7ca489877 Rename exportTo -> export
Because exportTo doesn't make sense if there is no parameter to which we're exporting.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
f2f993916d Rename import/export functions
They no longer mention the version number in their function names. I'd rather have named them import/export but that gave a name clash with Python's 'import' keyword.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
fdf37c2ab0 Codestyle: Start comments with space
Forgot this one.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
7ad2fbc95d Codestyle: Start comments with space
We didn't really discuss this one, but apparently it's in PEP8 so I'd better do it.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
cce642a3e1 Extrapolate settings translations
It is now in one place. Or rather, two: There is another function to translate only setting names.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00