Exemplo n.º 1
0
	def __init__(self):
		self.InitializeComponent()
		self._pictureBox1.Image = System.Drawing.Image.FromFile(globalvars.IMAGE)
		iniFile = dmutils.iniFile()
		self.theVersion = iniFile.read('Version')
		self.Text = 'Data Manager for ComicRack %s' % self.theVersion
		self.Icon = Icon(globalvars.ICON_SMALL)
Exemplo n.º 2
0
 def __init__(self):
     self.InitializeComponent()
     self._pictureBox1.Image = System.Drawing.Image.FromFile(
         globalvars.IMAGE)
     iniFile = dmutils.iniFile()
     self.theVersion = iniFile.read('Version')
     self.Text = 'Data Manager for ComicRack %s' % self.theVersion
     self.Icon = Icon(globalvars.ICON_SMALL)
Exemplo n.º 3
0
def replaceData(books):

    ERROR_LEVEL = 0

    if not crVersion(): return  # ComicRack version ok?

    s = File.ReadAllLines(globalvars.DATFILE)
    if not s[0].startswith('#@ VERSION'):
        MessageBox.Show(
            'Your configuration needs conversion.\nPlease use the configurator first.',
            'Data Manager %s' % globalvars.VERSION)
        return

    ini = dmutils.iniFile(globalvars.USERINI)
    if ini.read('ShowStartupDialog') == 'False':
        pass
    else:
        theForm = startupForm()
        theForm.ShowDialog()
        theForm.Dispose()

        if theForm.DialogResult == DialogResult.Yes:  # closed with Yes button
            pass
        elif theForm.DialogResult == DialogResult.Cancel:  # closed with window close button
            return
        elif theForm.DialogResult == DialogResult.No:  # closed with No button
            return
        elif theForm.DialogResult == DialogResult.Retry:  # closed with configure button
            dmConfig()
            return

    try:  # delete temporary files from last data manager run
        File.Delete(globalvars.TMPFILE)
        File.Delete(globalvars.ERRFILE)
        File.Delete(globalvars.LOGFILE)
    except Exception, err:
        MessageBox.Show(
            'One of the temporary files of the Data Manager could not be deleted.\nPlease restart ComicRack.'
        )
        return
Exemplo n.º 4
0
def dmConfig():
    '''
	runs the ruleset collection editor depending on the value of key GUI in user.ini
	if GUI == anything other than the value 'Old' it will run the exe defined in
	globalvars, else if will run the old minimalistic gui
	type: void
	'''
    myIni = iniFile(globalvars.USERINI)
    myGui = myIni.read('Gui')
    version = myIni.read('Version')

    if myGui <> 'Old':
        import System.Diagnostics
        p = System.Diagnostics.Process()
        p.StartInfo.FileName = globalvars.GUIEXE
        p.Start()
    else:
        form = configuratorForm()
        form.setFile(globalvars.DATFILE)
        form.Text = 'Data Manager Configurator %s' % version
        form.ShowDialog(ComicRack.MainWindow)
        form.Dispose()
Exemplo n.º 5
0
def dmConfig():
	'''
	runs the ruleset collection editor depending on the value of key GUI in user.ini
	if GUI == anything other than the value 'Old' it will run the exe defined in
	globalvars, else if will run the old minimalistic gui
	type: void
	'''
	myIni = iniFile(globalvars.USERINI)
	myGui = myIni.read('Gui')
	version = myIni.read('Version')
	
	if myGui <> 'Old':
		import System.Diagnostics
		p = System.Diagnostics.Process()
		p.StartInfo.FileName = globalvars.GUIEXE
		p.Start()
	else:
		form = configuratorForm()
		form.setFile(globalvars.DATFILE)
		form.Text = 'Data Manager Configurator %s' % version
		form.ShowDialog(ComicRack.MainWindow)
		form.Dispose()
	def __init__(self):
		self.InitializeComponent()
		self.isDirty = False
		self.theFile = ''
		self.searchLabelText = 'search ...'
		self.textBoxHeight = 500
		self.textBoxMinHeight = 260
		self.textBoxWidth = 760
		self.textBoxMinWidth = 717

		iniFile = dmutils.iniFile()
		self.theVersion = iniFile.read('Version')

		self.dictTextClips = {
			'commentary line': '# ', 
			'divider': '# %s' % ('-' * 30) , 
			'group header': '#@ GROUP ',
			'variable' : '#@ VAR ',
			'end of rules' : '#@ END_RULES',
			'end of group' : '#@ END_GROUP	',
			'author' : '#@ AUTHOR ',
			'notes' : '#@ NOTES ',
			'end of notes' : '#@ END_NOTES'
		}
		
		self.EDITOR_MODE_GUI = 0
		self.EDITOR_MODE_TEXT = 1
		self.editormode = self.EDITOR_MODE_GUI
		self.clearValuesAfterAdding = False
		self.rulefile = rulefile
		self.allowedKeys = rulefile.allowedKeys
		self.allowedVals = rulefile.allowedVals
#		self.numericalKeys = rulefile.numericalKeys
		self.allowedKeyModifiers = rulefile.allowedKeyModifiers
		self.allowedValModifiers = rulefile.allowedValModifiers
		self.MaximizeBox = False
		self.MinimizeBox = False
		self.Icon = Icon(globalvars.ICON_SMALL)
Exemplo n.º 7
0
def replaceData(books):

	ERROR_LEVEL = 0

	if not crVersion():	return		# ComicRack version ok?

	s = File.ReadAllLines(globalvars.DATFILE)
	if not s[0].startswith('#@ VERSION'):
		MessageBox.Show('Your configuration needs conversion.\nPlease use the configurator first.','Data Manager %s' % globalvars.VERSION)
		return

	ini = dmutils.iniFile(globalvars.USERINI)
	if ini.read('ShowStartupDialog') == 'False':
		pass
	else:
		theForm = startupForm()
		theForm.ShowDialog()
		theForm.Dispose()

		if theForm.DialogResult == DialogResult.Yes:		# closed with Yes button
			pass
		elif theForm.DialogResult == DialogResult.Cancel:	# closed with window close button
			return
		elif theForm.DialogResult == DialogResult.No:		# closed with No button
			return
		elif theForm.DialogResult == DialogResult.Retry:	# closed with configure button
			dmConfig()
			return
	
	try:		# delete temporary files from last data manager run
		File.Delete(globalvars.TMPFILE)
		File.Delete(globalvars.ERRFILE)
		File.Delete(globalvars.LOGFILE)
	except Exception, err:
		MessageBox.Show('One of the temporary files of the Data Manager could not be deleted.\nPlease restart ComicRack.')
		return
Exemplo n.º 8
0
 def StartupFormFormClosed(self, sender, e):
     if self.DialogResult <> DialogResult.Cancel:
         ini = dmutils.iniFile(globalvars.USERINI)
         ini.write('ShowStartupDialog', str(not self._checkBox1.Checked))
Exemplo n.º 9
0
def writeVersion():
    ''' not sure if we need this '''
    myIni = dmutils.iniFile()
    myIni.write('Version', globalvars.VERSION)
Exemplo n.º 10
0
	def StartupFormFormClosed(self, sender, e):
		if self.DialogResult <> DialogResult.Cancel:
			ini = dmutils.iniFile(globalvars.USERINI)
			ini.write('ShowStartupDialog', str(not self._checkBox1.Checked))
Exemplo n.º 11
0
def writeVersion():
	''' not sure if we need this '''
	myIni = dmutils.iniFile()
	myIni.write('Version',globalvars.VERSION)
Exemplo n.º 12
0
import System
import clr
import re
clr.AddReference("ComicRack.Engine")
from cYo.Projects.ComicRack.Engine import YesNo, MangaYesNo

import globalvars
import dmutils
from dmutils import customFields
customField = customFields()
from dmutils import ruleFile, iniFile, dmString, comparer, multiValue
dmString = dmString()
comparer = comparer()
multiValue = multiValue()
dataManIni = iniFile(globalvars.INIFILE)
userIni = iniFile(globalvars.USERINI)

class dmParser(object):
	
	def __init__(self):
		self.initializeVars()
		self.ruleFile = ruleFile()
		

	def initializeVars(self):
		self.error = False
		self.errCount = 0
		self.rules = []
		self.actions = []
		self.theRuleKey = ''