Skip to content

Commit

Permalink
Bugfix:
Browse files Browse the repository at this point in the history
Possible crash when settings file cannot be loaded.


New:
Configure form redesigned
Added multivalue fields: Penciller, Inker, Colorist, Letterer, Cover Artist, Editor and Locations.
Function to export all the profiles to a single file.
Added a way to run several profiles in sequence.
Option to mark operations with specific empty data as failed. Can also move these to a different failed folder.
Option when overwriting a book to copy the read percentage of the old book to the new one.


Changes:
Much code has been rewriten with many little tweaks and fixes.
Any field can be put in the prefix or suffix of any other field
Fixed incorrect wording in report.
Yes/No fields can now have text inserted when the value is no OR yes
Multiple value fields can now be entered exactly as in the comic info. Just delete the extra variables from the template, leaving the name: for example {<tags()(issue)>} becomes {<tags>}


Warnings:
No longer supports profiles from 1.6 and earlier. If any are imported, some options will be reset to default.
  • Loading branch information
Stonepaw committed Jan 17, 2012
1 parent 443b730 commit 8f95b10
Show file tree
Hide file tree
Showing 26 changed files with 213 additions and 102 deletions.
2 changes: 1 addition & 1 deletion Package.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name=Library Organizer
Author=Stonepaw
Version=1.8 RC1
Version=2.0
Description=A file and folder organizer with GUI that helps build you file and folder paths.
Image=lopackagelogo.png
KeepFiles=losettingsx.dat
Expand Down
109 changes: 50 additions & 59 deletions Program.py
Original file line number Diff line number Diff line change
@@ -1,66 +1,57 @@
import clr
"""
This file loads some sample comics from a file and shows the config form.
Simply for testing purposes.
"""


import clr
import System
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')
import System
from System.Windows.Forms import Application, MessageBox, DialogResult
import loconfigForm
import System.IO
from System.IO import FileStream, FileMode, File, Directory, Path, StreamWriter, StreamReader
clr.AddReference("System.Xml")
clr.AddReferenceToFileAndPath("C:\\Program Files\\ComicRack\\ComicRack.Engine.dll")
clr.AddReferenceToFileAndPath("C:\\Program Files\\ComicRack\\cYo.Common.dll")

from System.Runtime.Serialization.Formatters.Binary import BinaryFormatter
clr.AddReferenceToFile("ComicRack.Engine")
clr.AddReferenceToFile("cYo.Common")
import cYo.Common
import cYo.Projects.ComicRack.Engine
from cYo.Projects.ComicRack.Engine import *
import libraryorganizer
import cPickle

from System.Xml import XmlDocument

from System.IO import StreamReader, File, FileStream, FileMode

from System.Windows.Forms import Application, DialogResult
import configureform

import losettings
import loworkerform
import loduplicate
import System.Text
from System.Text import StringBuilder
clr.AddReference("System.Xml")
import System.Xml
from System.Xml import XmlWriter, Formatting, XmlTextWriter, XmlWriterSettings, XmlDocument
clr.AddReference("System.Core")
from System import Func
import loconfigForm
import loforms

from loworkerform import ProfileSelector

SETTINGSFILE = "losettingsx.dat"

try:
#sfrom libraryorganizer import OverwriteAction
# i.ShowDialog()
# """ print __file__[0:-len("Program.py")]
Application.EnableVisualStyles()
#s = libraryorganizer.LoadSettings()
f = FileStream("Sample.dat", FileMode.Open)
s = BinaryFormatter()
books = s.Deserialize(f)
#for book in bbooks:
#print book.ShadowSeries
#print book.Series
#print book.Number
f.Close()

#a = loforms.SelectionFormArgs(["test", "test", "testt"], "Writer", "Green Lantern Vol. 2009 #12", False)
#fff = loforms.SelectionForm(a)
#fff.ShowDialog()


settings, lastused = libraryorganizer.LoadSettings()
#Get a random book to use as an example
config = loconfigForm.ConfigForm(books, settings, lastused)
result = config.ShowDialog()
if result == DialogResult.OK:
config.SaveSettings()
lastused = config._cmbProfiles.SelectedItem
#Now save the settings
libraryorganizer.SaveSettings(settings, lastused)

System.Console.ReadLine()
print "Loading test data"
f = FileStream("Sample.dat", FileMode.Open)
bf = BinaryFormatter()
books = bf.Deserialize(f)
print "Done loading sample data"
print "Starting to load profiles"
profiles, last_used_profiles = losettings.load_profiles(SETTINGSFILE)
print "Done loading profiles"
Application.EnableVisualStyles()

selector = ProfileSelector(profiles.keys(), last_used_profiles)

selector.ShowDialog()

print selector.get_profiles_to_use()

form = configureform.ConfigureForm(profiles, last_used_profiles[0], books)
r = form.ShowDialog()

if r != DialogResult.Cancel:
form.save_profile()
last_used_profile = form._profile_selector.SelectedItem
losettings.save_profiles(SETTINGSFILE, profiles, last_used_profile)
except Exception, ex:
print "An error occured"
print Exception
print ex
print type(ex)
System.Console.ReadLine()
print ex
System.Console.ReadKey()

Binary file added add_16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added arrow_down_16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added blue_arrow_up_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Changes:
Much code has been rewriten with many little tweaks and fixes.
Any field can be put in the prefix or suffix of any other field
Fixed incorrect wording in report.
Yes/No fields can now have text inserted when the value is no OR yes
Multiple value fields can now be entered exactly as in the comic info. Just delete the extra variables from the template, leaving the name: for example {<tags()(issue)>} becomes {<tags>}


Expand Down
Binary file added chart_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added close_16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 23 additions & 1 deletion configformcontrols.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
import clr
"""
configformcontrols.py
Contains various custom controls used in the config form .
Copyright 2010-2012 Stonepaw
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""



import clr

import System

Expand Down
26 changes: 25 additions & 1 deletion configureform.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
import clr
"""
configureform.py
Contains the Configure form.
Copyright 2010-2012 Stonepaw
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""





import clr

import System

Expand Down
5 changes: 3 additions & 2 deletions credits.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
Much of the code is based from wadegiles's Guided eComic file renaming was used. Kudos to him for creating it in the first place.
The inspiration for this script comes from wadegiles's Guided eComic file renaming and some code is based on that script.
Thanks to him for creating it in the first place.
That script can be found at: http://comicrack.cyolito.com/user-forum/13-scripts/807-guided-ecomic-file-renaming-full-gui

Thanks to pescuma for the fix in duplicate naming.

The very nice icons are by David Vignoni and are released under the LGPL licence which can be found here:
The very nice book icon is by David Vignoni and is released under the LGPL licence which can be found here:
http://www.gnu.org/licenses/lgpl.html

The icon itself was found at: http://www.iconfinder.com/icondetails/1228/128/bookcase_books_school_icon
Expand Down
Binary file added folder_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added home_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 14 additions & 4 deletions libraryorganizer.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
"""
libraryorganizer.py
The main script file. Some code is this file is based off of wadegiles's Guided eComic file renaming script. Credit is very much due to him
The entry area for ComicRack
Version 1.8
Version 2.0
Author: Stonepaw
Copyright 2010-2012 Stonepaw
Copyright Stonepaw 2011. Some code copyright wadegiles Anyone is free to use code from this file as long as credit is given.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

import clr
Expand Down
20 changes: 15 additions & 5 deletions lobookmover.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,22 @@
This contains all the book moving fuction the script uses. Also the path generator
Version 1.7.17
Fixed error with fileless images
Added Alternate Series into the multi selection
Version 2.0:
Copyright 2010-2012 Stonepaw
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Copyright Stonepaw 2011. Some code copyright wadegiles Anyone is free to use code from this file as long as credit is given.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""


Expand Down
19 changes: 13 additions & 6 deletions locommon.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@
Author: Stonepaw
Version: 1.7.5
-Added ReadPercentage to Rules
Contains several classes and functions. All are used in several files
Copyright 2010-2012 Stonepaw
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Copyright Stonepaw 2011. Anyone is free to use code from this file as long as credit is given.
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

Expand Down Expand Up @@ -37,7 +44,7 @@

UNDOFILE = Path.Combine(SCRIPTDIRECTORY, "undo.dat")

VERSION = 1.8
VERSION = 2.0

clr.AddReferenceByPartialName('ComicRack.Engine')
from cYo.Projects.ComicRack.Engine import MangaYesNo, YesNo
Expand Down Expand Up @@ -155,7 +162,7 @@ def load_from_xml(self, xml_node):
"""Loads the rules and groups from the xml_node."""
for node in xml_node.ChildNodes:
if node.Name == "ExcludeRule":
#Changes from 1.7.17 to 1.8
#Changes from 1.7.17 to 2.0
try:
self.add_rule(ExcludeRule(node.Attributes["Field"].Value, node.Attributes["Operator"].Value, node.Attributes["Value"].Value))
except AttributeError:
Expand Down
17 changes: 13 additions & 4 deletions loduplicate.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,23 @@
Author: Stonepaw
Version 1.7.4
Wasn't removing covers when it needed to
Description: Contains a Form for displaying two comic images and various information
Copyright Stonepaw 2011. Anyone is free to use code from this file as long as credit is given.
Copyright 2010-2012 Stonepaw
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

Expand Down
17 changes: 14 additions & 3 deletions loforms.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
"""loforms.py
"""
loforms.py
This file contains various dialogs and forms required by the Library Orgainizer
Version 1.7.17
Copyright 2010-2012 Stonepaw
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Copyright Stonepaw 2011. Anyone is free to use code from this file as long as credit is given.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

import clr
Expand Down
15 changes: 13 additions & 2 deletions lologger.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,20 @@
Contains a class for logging what the bookmover does.
1.7.12: Fix for unicode characters
Copyright Stonepaw
Copyright 2010-2012 Stonepaw
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

import clr
Expand Down
Loading

0 comments on commit 8f95b10

Please sign in to comment.