Removed a hardcoded string from code
authorHarishankar <v.harishankar@gmail.com>
Wed, 7 Dec 2011 13:38:09 +0000 (19:08 +0530)
committerHarishankar <v.harishankar@gmail.com>
Wed, 7 Dec 2011 13:38:09 +0000 (19:08 +0530)
Removed a hardcoded string "current" from the code.

biacv_exporter.py
biacv_mainwindow.py
templates/default_xhtml/misc_strings.txt

index d027e71..3900c76 100644 (file)
@@ -153,9 +153,13 @@ class BiaCVExporter:
                lst_profession = []
                # loop through each item
                for item in self.data["professionalhistory"]:
+                       if item["leavedate"] == "":
+                               leavedate_str = self.lang_strings[6]
+                       else:
+                               leavedate_str = item["leavedate"]
                        str_profession = tpl_profession.safe_substitute (
                                        joindate = item["joindate"],
-                                       leavedate= item["leavedate"],
+                                       leavedate = leavedate_str,
                                        organization = item["organization"],
                                        jobtitle = item["jobtitle"],
                                        additionalinfo = item["additionalinfo"]
index 09bf77d..8e4eb5f 100644 (file)
@@ -609,9 +609,9 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow):
                        PyQt4.QtGui.QMessageBox.critical (self, lang.ERROR_UPDATE, lang.ERROR_REQ_MISSING)
                        return
                # if currently employed in that position, leaving date is to be disabled
-               # and set to "current"
+               # and set to empty
                if self.currentemployment.isChecked ():
-                       leavedatestr = "current"
+                       leavedatestr = ""
                else:
                        # if the leaving date is < join date
                        if self.leavedate.date () < self.joindate.date ():
@@ -651,9 +651,9 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow):
                        PyQt4.QtGui.QMessageBox.critical (self, lang.ERROR_ADD, lang.ERROR_REQ_MISSING)
                        return
                # if currently employed in that position, leaving date is to be disabled
-               # and set to "current"
+               # and set to ""
                if self.currentemployment.isChecked ():
-                       leavedatestr = "current"
+                       leavedatestr = ""
                else:
                        # if the leaving date is < join date
                        if self.leavedate.date () < self.joindate.date ():
@@ -689,7 +689,7 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow):
                selitem = selitems[0]
                self.designation.setText (selitem.text (0))
                self.joindate.setDate (PyQt4.QtCore.QDate.fromString (selitem.text(1), "dd MMM, yyyy"))
-               if selitem.text (2) == "current":
+               if selitem.text (2) == "":
                        self.leavedate.setEnabled (False)
                        self.currentemployment.setChecked (True)
                else:
index 97014f7..7fc600b 100644 (file)
@@ -3,4 +3,5 @@ can read/write;
 proficient;
 Married
 Single
-Unspecified
\ No newline at end of file
+Unspecified
+present
\ No newline at end of file