Пример #1
0
    def createTab1(self):

        #frame
        self.labelFrame = ttk.LabelFrame(self.tab1, text='Specify Book ID:')
        self.labelFrame.grid(column=0, row=0, padx=20, pady=20)

        #style
        styleForTextBox = ttk.Style()
        styleForTextBox.configure('TEntry', font=('Courier', 24), padding=4)

        #label 1
        self.label1 = ttk.Label(self.labelFrame, text="Book ID:")
        self.label1.grid(column=0, row=1, sticky="w")

        #textbox 1
        self.bookid = tk.StringVar()
        #load config value
        cf = config_handler.ConfigHandler()
        value = cf.get_config_value(cf.RECENT_BOOK_ID)

        self.bookid.set(value)
        self.textbox1 = ttk.Entry(self.labelFrame,
                                  width=90,
                                  textvariable=self.bookid)
        self.textbox1.grid(column=0, row=2, sticky="w")

        #button 1
        self.button1 = ttk.Button(self.labelFrame,
                                  text="Save ID",
                                  command=self.saveBookID)
        self.button1.grid(column=1, row=2, sticky="w")

        #label 2
        self.label2 = ttk.Label(self.labelFrame,
                                text="Select Output Directory:")
        self.label2.grid(column=0, row=4, sticky="w")

        #textbox 2
        self.filepath2 = tk.StringVar()
        #load config value
        cf = config_handler.ConfigHandler()
        value = cf.get_config_value(cf.RECENT_OUTPUT_DIR)
        self.filepath2.set(value)
        self.path2 = ttk.Entry(self.labelFrame,
                               width=90,
                               textvariable=self.filepath2)
        self.path2.grid(column=0, row=5, sticky="w")

        #button 3
        self.button3 = ttk.Button(self.labelFrame,
                                  text="Browse Directory",
                                  command=self.dirDialog)
        self.button3.grid(column=1, row=5, sticky="w")

        #button no 5
        self.button5 = ttk.Button(self.labelFrame,
                                  text="START PROCESS",
                                  command=self.processText)
        self.button5.grid(column=0, row=7)
Пример #2
0
    def createTab1(self):
        #frame

        self.labelFrame = ttk.LabelFrame(self.tab1,
                                         text='Select a word data file:')
        self.labelFrame.grid(column=0, row=0, padx=20, pady=20)

        s = ttk.Style()
        s.configure('TEntry', font=('Courier', 24), padding=4)

        #textbox 1
        self.filepath = tk.StringVar()
        #load config value
        cf = config_handler.ConfigHandler()
        value = cf.get_config_value(cf.RECENT_OPEN_FILE)
        self.filepath.set(value)
        self.path3 = ttk.Entry(self.labelFrame,
                               width=90,
                               textvariable=self.filepath)
        self.path3.grid(column=0, row=1, sticky="w")

        #button 1
        self.button1 = ttk.Button(self.labelFrame,
                                  text="Browse A File",
                                  command=self.fileDialog)
        self.button1.grid(column=1, row=1, sticky="w")

        #label 7
        self.label7 = ttk.Label(self.labelFrame, text="Book ID:")
        self.label7.grid(column=0, row=2, sticky="w")

        #textbox 4
        self.bookid = tk.StringVar()
        #load config value
        cf = config_handler.ConfigHandler()
        value = cf.get_config_value(cf.RECENT_BOOK_ID)

        self.bookid.set(value)
        self.textbox4 = ttk.Entry(self.labelFrame,
                                  width=90,
                                  textvariable=self.bookid)
        self.textbox4.grid(column=0, row=3, sticky="w")

        #button no 6
        self.button6 = ttk.Button(self.labelFrame,
                                  text="Save ID",
                                  command=self.saveBookID)
        self.button6.grid(column=1, row=3, sticky="w")

        #label 7
        self.label8 = ttk.Label(self.labelFrame,
                                text="Click button to start processing text:")
        self.label8.grid(column=0, row=4, sticky="w")
        #button no 7
        self.button7 = ttk.Button(self.labelFrame,
                                  text="Start Upload",
                                  command=self.uploadData)
        self.button7.grid(column=0, row=5)
    def createTab2(self):
        #frame

        self.labelFrame2 = ttk.LabelFrame(self.tab2,
                                          text='Select a JSON file:')
        self.labelFrame2.grid(column=0, row=0, padx=20, pady=20)

        #textboxvv21
        self.filepath21 = tk.StringVar()
        #load defaults
        cf = config_handler.ConfigHandler()
        value = cf.get_config_value(cf.RECENT_OPEN_FILE2)
        self.filepath21.set(value)

        self.path21 = ttk.Entry(self.labelFrame2,
                                width=90,
                                textvariable=self.filepath21)
        self.path21.grid(column=0, row=1, sticky="w")

        #button 21
        self.button21 = ttk.Button(self.labelFrame2,
                                   text="Browse A File",
                                   command=self.fileDialog2)
        self.button21.grid(column=1, row=1, sticky="w")

        #label 7
        self.label7 = ttk.Label(self.labelFrame2, text="Book ID:")
        self.label7.grid(column=0, row=2, sticky="w")

        #textbox 4
        self.bookid = tk.StringVar()
        #load config value
        cf = config_handler.ConfigHandler()
        value = cf.get_config_value(cf.RECENT_BOOK_ID)

        self.bookid.set(value)
        self.textbox4 = ttk.Entry(self.labelFrame2,
                                  width=90,
                                  textvariable=self.bookid)
        self.textbox4.grid(column=0, row=3, sticky="w")

        #button no 6
        self.button6 = ttk.Button(self.labelFrame2,
                                  text="Save ID",
                                  command=self.saveBookID)
        self.button6.grid(column=1, row=3, sticky="w")

        #label 7
        self.label8 = ttk.Label(self.labelFrame2,
                                text="Click button to start processing text:")
        self.label8.grid(column=0, row=4, sticky="w")
        #button no 7
        self.button7 = ttk.Button(self.labelFrame2,
                                  text="Start Upload",
                                  command=self.uploadData)
        self.button7.grid(column=0, row=5)
    def createTab1(self):
        #frame

        self.labelFrame = ttk.LabelFrame(self.tab1,
                                         text='Select an clean text:')
        self.labelFrame.grid(column=0, row=0, padx=20, pady=20)

        #textbox
        self.filepath = tk.StringVar()
        #load defaults
        cf = config_handler.ConfigHandler()
        value = cf.get_config_value(cf.RECENT_OPEN_FILE)
        self.filepath.set(value)
        s = ttk.Style()
        s.configure('TEntry', font=('Courier', 24), padding=4)

        self.path = ttk.Entry(self.labelFrame,
                              width=90,
                              textvariable=self.filepath)
        self.path.grid(column=0, row=1, sticky="w")

        #button 1
        self.button1 = ttk.Button(self.labelFrame,
                                  text="Browse A File",
                                  command=self.fileDialog)
        self.button1.grid(column=1, row=1, sticky="w")

        #label 2
        self.label2 = ttk.Label(self.labelFrame,
                                text="Select Output Directory:")
        self.label2.grid(column=0, row=2, sticky="w")

        #textbox 2
        self.filepath2 = tk.StringVar()
        #load config value
        cf = config_handler.ConfigHandler()
        value = cf.get_config_value(cf.RECENT_OUTPUT_DIR)
        self.filepath2.set(value)
        self.path2 = ttk.Entry(self.labelFrame,
                               width=90,
                               textvariable=self.filepath2)
        self.path2.grid(column=0, row=3, sticky="w")

        #button 3
        self.button3 = ttk.Button(self.labelFrame,
                                  text="Browse Directory",
                                  command=self.dirDialog)
        self.button3.grid(column=1, row=3, sticky="w")

        #button no 5
        self.button5 = ttk.Button(self.labelFrame,
                                  text="START PROCESS",
                                  command=self.processText)
        self.button5.grid(column=0, row=5)
Пример #5
0
    def createTab2(self):
        #frame

        self.labelFrame2 = ttk.LabelFrame(self.tab2,
                                          text='Select trash file to recycle:')
        self.labelFrame2.grid(column=0, row=0, padx=20, pady=20)

        #textboxvv21
        self.filepath21 = tk.StringVar()
        #load defaults
        cf = config_handler.ConfigHandler()
        value = cf.get_config_value(cf.RECENT_OPEN_FILE2)
        self.filepath21.set(value)

        self.path21 = ttk.Entry(self.labelFrame2,
                                width=90,
                                textvariable=self.filepath21)
        self.path21.grid(column=0, row=1, sticky="w")

        #button 21
        self.button21 = ttk.Button(self.labelFrame2,
                                   text="Browse A File",
                                   command=self.fileDialog2)
        self.button21.grid(column=1, row=1, sticky="w")

        #label 22
        self.label22 = ttk.Label(self.labelFrame2,
                                 text="Select Output Directory:")
        self.label22.grid(column=0, row=2, sticky="w")

        #textbox 22
        self.filepath22 = tk.StringVar()
        #load config value
        cf = config_handler.ConfigHandler()
        value = cf.get_config_value(cf.RECENT_OUTPUT_DIR2)
        self.filepath22.set(value)
        self.path22 = ttk.Entry(self.labelFrame2,
                                width=90,
                                textvariable=self.filepath22)
        self.path22.grid(column=0, row=3, sticky="w")

        #button 23
        self.button23 = ttk.Button(self.labelFrame2,
                                   text="Browse Directory",
                                   command=self.dirDialog2)
        self.button23.grid(column=1, row=3, sticky="w")

        #button no 25
        self.button25 = ttk.Button(self.labelFrame2,
                                   text="START PROCESS",
                                   command=self.processText2)
        self.button25.grid(column=0, row=5)
Пример #6
0
 def fileDialog42(self):
     self.filename42 = filedialog.askopenfilename(initialdir = "E:/FULLTEXT/DICTIONARY/LOWERCASE", 
         title = "Select custom word list", filetypes = (("Text files", "*.txt"), ("all files", "*.*")))
     if (self.filename42):
         self.filepath42.set(self.filename42) 
         cf = config_handler.ConfigHandler()
         cf.set_config_value(cf.RECENT_OPEN_FILE2,self.filename42)
Пример #7
0
 def fileDialog41(self):
     self.filename41 = filedialog.askopenfilename(initialdir = "E:/FULLTEXT/DICTIONARY/LOWERCASE", 
         title = "Select standard word list", filetypes = (("Text files", "*.txt"), ("all files", "*.*")))
     if (self.filename41):
         self.filepath41.set(self.filename41) #set the textbox to the file path
         cf = config_handler.ConfigHandler()
         cf.set_config_value(cf.RECENT_OPEN_FILE,self.filename41)
Пример #8
0
    def createTab3(self):
        #TAB 3 ----SECTION 0------------------------------------------------------------------------------
        self.labelFrame3 = ttk.LabelFrame(self.tab3, text= 'Recycle Marged File:',  borderwidth = 1,  relief="raised")
        self.labelFrame3.grid(column=0, row=0, padx = 20, pady = 20)


        #TAB 3 ----SECTION 1------------------------------------------------------------------------------
        #label 31
        self.label31 = ttk.Label(self.labelFrame3, text="Select manually cleaned merged file:")
        self.label31.grid(column = 0, row = 0,  padx = 20, pady = 0, sticky = "w")


        #textbox 31
        self.filepath31 = tk.StringVar()
        #load defaults
        cf = config_handler.ConfigHandler()
        value = cf.get_config_value(cf.RECENT_OPEN_FILE3)
        self.filepath31.set(value)


        self.path31 = ttk.Entry(self.labelFrame3, width=90, textvariable = self.filepath31)
        self.path31.grid(column = 0, row = 1, padx = (20, 0), pady = 10, sticky = "w")

        #button 31
        self.button31 = ttk.Button(self.labelFrame3, text = "Browse File", command=self.fileDialog31)
        self.button31.grid(column = 1, row = 1, padx = (0, 20), pady = 10, sticky = "w")
        #TAB 3 ----SECTION 2------------------------------------------------------------------------------
  
       #label 32
        self.label32 = ttk.Label(self.labelFrame3, text="Click button to start recycling:")
        self.label32.grid(column = 0, row = 2, sticky = "w", padx = 20, pady = (20, 0) )
        
        #button no 32
        self.button32 = ttk.Button(self.labelFrame3, text = "START PROCESS", command=self.processText3)
        self.button32.grid(column = 0, row = 3, padx = 20, pady = (0, 20) )
Пример #9
0
    def createTab2(self):

        #TAB 2 ----SECTION 0------------------------------------------------------------------------------
        self.labelFrame2 = ttk.LabelFrame(self.tab2, text= 'Output Directory:',  borderwidth = 1,  relief="raised")
        self.labelFrame2.grid(column=0, row=0, padx = 20, pady = 20)


        #TAB 2 ----SECTION 1------------------------------------------------------------------------------
        #label 21
        self.label21 = ttk.Label(self.labelFrame2, text="Select output director for merged file:")
        self.label21.grid(column = 0, row = 0,  padx = 20, pady = 0, sticky = "w")
        
        self.filepath21 = tk.StringVar()
        #load config value
        cf = config_handler.ConfigHandler()
        value = cf.get_config_value(cf.RECENT_OUTPUT_DIR2)
        self.filepath21.set(value) 
        self.path21 = ttk.Entry(self.labelFrame2, width=90, textvariable = self.filepath21)
        self.path21.grid(column = 0, row = 1, sticky = "w", padx=(20, 0), pady = 20)
        
        #button 21
        self.button21 = ttk.Button(self.labelFrame2, text = "Browse Folder", command=self.dirDialog21)
        self.button21.grid(column = 1, row = 1, sticky = "w", padx = (0, 20), pady = 20)
  
        #label 22
        self.label22 = ttk.Label(self.labelFrame2, text="Click button to start merging:")
        self.label22.grid(column = 0, row = 2, sticky = "w", padx = 20, pady = (20, 0) )
        
        #button no 22
        self.button22 = ttk.Button(self.labelFrame2, text = "START PROCESS", command=self.processText2)
        self.button22.grid(column = 0, row = 3, padx = 20, pady = (0, 20) )
Пример #10
0
    def createTab2(self):
        #frame

        self.labelFrame2 = ttk.LabelFrame(self.tab2,
                                          text='Select a stop-word data file:')
        self.labelFrame2.grid(column=0, row=0, padx=20, pady=20)

        #textbox 21
        self.filepath21 = tk.StringVar()
        #load config value
        cf = config_handler.ConfigHandler()
        value = cf.get_config_value(cf.RECENT_OPEN_FILE_2)
        self.filepath21.set(value)
        self.path21 = ttk.Entry(self.labelFrame2,
                                width=90,
                                textvariable=self.filepath21)
        self.path21.grid(column=0, row=1, sticky="w")

        #button 21
        self.button21 = ttk.Button(self.labelFrame2,
                                   text="Browse A File",
                                   command=self.fileDialog2)
        self.button21.grid(column=1, row=1, sticky="w")

        #label 21
        self.label21 = ttk.Label(self.labelFrame2,
                                 text="Click button to start processing text:")
        self.label21.grid(column=0, row=4, sticky="w")
        #button no 22
        self.button22 = ttk.Button(self.labelFrame2,
                                   text="Start Upload",
                                   command=self.uploadData2)
        self.button22.grid(column=0, row=5)
Пример #11
0
    def createTab3(self):
        #frame

        self.labelFrame3 = ttk.LabelFrame(self.tab3,
                                          text='Select a mapping data file:')
        self.labelFrame3.grid(column=0, row=0, padx=20, pady=20)

        #textbox 31
        self.filepath31 = tk.StringVar()
        #load config value
        cf = config_handler.ConfigHandler()
        value = cf.get_config_value(cf.RECENT_OPEN_FILE_3)
        self.filepath31.set(value)
        self.path31 = ttk.Entry(self.labelFrame3,
                                width=90,
                                textvariable=self.filepath31)
        self.path31.grid(column=0, row=1, sticky="w")

        #button 31
        self.button31 = ttk.Button(self.labelFrame3,
                                   text="Browse A File",
                                   command=self.fileDialog31)
        self.button31.grid(column=1, row=1, sticky="w")

        #label 31
        self.label31 = ttk.Label(self.labelFrame3,
                                 text="Click button to start processing text:")
        self.label31.grid(column=0, row=4, sticky="w")
        #button no 32
        self.button32 = ttk.Button(self.labelFrame3,
                                   text="Start Upload",
                                   command=self.uploadData31)
        self.button32.grid(column=0, row=5)
Пример #12
0
    def createTab4(self):

        self.labelFrame4 = ttk.LabelFrame(self.tab4,
                                          text='Select a word pair file:')
        self.labelFrame4.grid(column=0, row=0, padx=20, pady=20)

        #textbox 41
        self.filepath41 = tk.StringVar()
        #load config value
        cf = config_handler.ConfigHandler()
        value = cf.get_config_value(cf.RECENT_OPEN_FILE_4)
        self.filepath41.set(value)
        self.path41 = ttk.Entry(self.labelFrame4,
                                width=90,
                                textvariable=self.filepath41)
        self.path41.grid(column=0, row=1, sticky="w")

        #button 41
        self.button41 = ttk.Button(self.labelFrame4,
                                   text="Browse A File",
                                   command=self.fileDialog41)
        self.button41.grid(column=1, row=1, sticky="w")

        #label 41
        self.label41 = ttk.Label(self.labelFrame4,
                                 text="Click button to start processing text:")
        self.label41.grid(column=0, row=4, sticky="w")
        #button no 32
        self.button42 = ttk.Button(self.labelFrame4,
                                   text="Start Upload",
                                   command=self.uploadData41)
        self.button42.grid(column=0, row=5)
Пример #13
0
 def fileDialog31(self):
     self.filename31 = filedialog.askopenfilename(initialdir = "E:/FULLTEXT/PAIR/CLEANMERGE", 
         title = "Select standard word list", filetypes = (("Text files", "*.txt"), ("all files", "*.*")))
     if (self.filename31):
         self.filepath31.set(self.filename31)
         cf = config_handler.ConfigHandler()
         cf.set_config_value(cf.RECENT_OPEN_FILE3,self.filename31)
Пример #14
0
 def dirDialog(self):
     self.filename2 = filedialog.askdirectory()
     if (self.filename2):
         self.filepath2.set(
             self.filename2)  #set the textbox to the file path
         cf = config_handler.ConfigHandler()
         cf.set_config_value(cf.RECENT_OUTPUT_DIR, self.filename2)
 def fileDialog(self):
     self.filename = filedialog.askopenfilename(
         initialdir="E:/FULLTEXT/TEXT/CLEANTEXT",
         title="Select a clean text",
         filetypes=(("Text files", "*.txt"), ("all files", "*.*")))
     if (self.filename):
         self.filepath.set(self.filename)  #set the textbox to the file path
         #self.button2.config(state = "normal")
         cf = config_handler.ConfigHandler()
         cf.set_config_value(cf.RECENT_OPEN_FILE, self.filename)
Пример #16
0
    def fileDialog(self):
        self.filename = filedialog.askopenfilename(
            initialdir="E:/FULLTEXT/WORD/DATABASE",
            title="Select a file",
            filetypes=(("Text files", "*.txt"), ("all files", "*.*")))
        if (self.filename):
            self.filepath.set(self.filename)

            cf = config_handler.ConfigHandler()
            cf.set_config_value(cf.RECENT_OPEN_FILE, self.filename)
Пример #17
0
    def fileDialog2(self):
        self.filename21 = filedialog.askopenfilename(
            initialdir="E:/FULLTEXT/DICTIONARY/SPECIALTY",
            title="Select a file",
            filetypes=(("Text files", "*.txt"), ("all files", "*.*")))
        if (self.filename21):
            self.filepath21.set(self.filename21)

            cf = config_handler.ConfigHandler()
            cf.set_config_value(cf.RECENT_OPEN_FILE_2, self.filename21)
 def fileDialog2(self):
     self.filename21 = filedialog.askopenfilename(
         initialdir="E:/FULLTEXT/SENTENCE/JSON",
         title="Select a JSON file",
         filetypes=(("JSON files", "*.json"), ("all files", "*.*")))
     if (self.filename21):
         self.filepath21.set(
             self.filename21)  #set the textbox to the file path
         #self.button2.config(state = "normal")
         cf = config_handler.ConfigHandler()
         cf.set_config_value(cf.RECENT_OPEN_FILE2, self.filename21)
Пример #19
0
 def fileDialog(self):
     self.filename = filedialog.askopenfilename(
         initialdir="E:/FULLTEXT/ORIGINAL",
         title="Select a file",
         filetypes=(("PDF files", "*.pdf"), ("EPUB files", "*.epub"),
                    ("all files", "*.*")))
     if (self.filename):
         self.filepath.set(self.filename)  #set the textbox to the file path
         #self.button2.config(state = "normal")
         cf = config_handler.ConfigHandler()
         cf.set_config_value(cf.RECENT_OPEN_FILE, self.filename)
 def __init__(self, moist_sensor, error_contr):
     self._config = config_handler.ConfigHandler()
     self.moisture_sensor = moist_sensor
     self.pump = pump_control.Pump()
     # vars set from config
     self.water_not_detected_thresshold = 0
     self.water_detected_by_incress = 0
     self.timeout = 0
     self.pumping_duration = 0
     self.update_from_config()
     self.error_controler = error_contr
     self.is_pumping = False
Пример #21
0
    def __init__(self):
        cmd.Cmd.__init__(self)
        self.config_manager = config_handler.ConfigHandler()
        self.config = self.config_manager.get_config()
        self.per = period.Period()
        self.connection = utm_connect.ServerConnect(self.config)
        self.prompt = 'Period (%s %s) Connect (%s) >>> ' % (
            self.per.get_period()[0], self.per.get_period()[1],
            self.connection.get_status())
        self.intro = 'Вас приветствует DGenerator. Для получения справки введите ? или воспользуйтесь командой help'
        self.doc_header = 'Доступные команды (для справки по конкретной команде наберите "help <Команда>")'

        locale.setlocale(locale.LC_ALL, 'Russian_Russia.1251')
Пример #22
0
def main():
    schedule = scheduler.Scheduler()

    config = config_handler.ConfigHandler()
    sensors = sensor_control.Sensor()
    buzzer = buzzer_control.Buzzer(config)
    error_handler = error_control.ErrorControl(buzzer, sensors, config, schedule)
    tank = tank_control.TankControl(config, error_handler=error_handler)
    moisture = moisture_check.MoistureCheck(
        config, sensors, tank, error_handler)
    recorder = record_data.RecordData(config, sensors)
    email_spread = email_spreadsheet.Email_Spreadsheet(config, schedule)

    schedule.register_task('config_reload', config.run,
                           (), 0)

    schedule.register_task(
        'stop',
        check_for_stop,
        (schedule,
         config,
         time.time()))
    schedule.add_to_schedule('stop', 0)  # 86400)

    schedule.register_task(
        'update_leds', tank.run, (), 0)

    schedule.register_task(
        'check_for_errors',
        error_handler.run,
        (), 0)

    schedule.register_task(
        'check_moisture_level',
        moisture.run,
        (), 0)

    schedule.register_task(
        'update_csv', recorder.run, (), 0)

    schedule.register_task(
        'email_spreadsheet',
        email_spread.send_email_every_week,
        ("data.csv", ),
        time.time() + 5)
    # all tasks need to be before run scheduler

    schedule.run_scheduler()
    def createTab3(self):
        #frame

        self.labelFrame3 = ttk.LabelFrame(self.tab3, text='Log File:')
        self.labelFrame3.grid(column=0, row=0, padx=20, pady=20)

        #textbox 31
        self.filepath31 = tk.StringVar()
        #load config value
        cf = config_handler.ConfigHandler()
        value = cf.get_config_value(cf.RECENT_OUTPUT_DIR3)
        self.filepath31.set(value)
        self.path31 = ttk.Entry(self.labelFrame3,
                                width=90,
                                textvariable=self.filepath31)
        self.path31.grid(column=0, row=3, sticky="w")

        #button 31
        self.button31 = ttk.Button(self.labelFrame3,
                                   text="Browse Directory",
                                   command=self.dirDialog3)
        self.button31.grid(column=1, row=3, sticky="w")
Пример #24
0
    def createTab1(self):
      
        #TAB NO 1  SECTION 0
        self.labelFrame1 = ttk.LabelFrame(self.tab1, text= 'Select a clean map file:', borderwidth = 1,  relief="raised")
        self.labelFrame1.grid(column=0, row=0, padx = 20, pady = 20)
        #STYLE SETTINGS
        style = ttk.Style()
        style.configure('TLabelframe.Label', font='arial 11 bold')
        style.configure('TEntry', font = ('Courier', 24), padding = 4)


        #TAB NO-1 SECTION NO-1======================================================================
        #label 
        self.label11 = ttk.Label(self.labelFrame1, text="Generation Output Folder:")
        self.label11.grid(column = 0, row = 1,  padx = 20, pady = 0, sticky = "w")

        self.filepath11 = tk.StringVar()
        #load config value
        cf = config_handler.ConfigHandler()
        value = cf.get_config_value(cf.RECENT_OUTPUT_DIR)
        self.filepath11.set(value) 
        self.path11 = ttk.Entry(self.labelFrame1, width=90, textvariable = self.filepath11)
        self.path11.grid(column = 0, row = 2, padx = (20, 0), pady = 10, sticky = "w")
   

        #button 11
        self.button11 = ttk.Button(self.labelFrame1, text = "Browse...", command=self.dirDialog11)
        self.button11.grid(column = 1, row = 2, padx = (0, 20) , pady = 10, sticky = "w")
  


        #TAB NO-1 SECTION NO-2======================================================================
        #label 11
        self.label12 = ttk.Label(self.labelFrame1, text="Click button to start generating word pairs:")
        self.label12.grid(column = 0, row = 3, padx = 20, pady = (20,0) , sticky = "w")
        
        #button 12        
        self.button12 = ttk.Button(self.labelFrame1, text = "START PROCESS", command=self.processText1)
        self.button12.grid(column = 0, row = 4, padx = 20, pady = (0, 20))
Пример #25
0
import os
import config_handler

__all__ = ["network_base"]
CONFIG = config_handler.ConfigHandler()
STRINGS = config_handler.ConfigHandler(conf_type=config_handler.ConfigHandler.STRINGS, section="network")

DLL_FILENAME = CONFIG.get("default", "dll_file_name")
DLL_PATH = "{0}\\{1}".format(os.path.dirname(os.path.realpath(__file__)), DLL_FILENAME)
DLL_PATH = r"C:\Users\Guy\Documents\EasyDLP\src\Network\Debug\network_lib.dll"
Пример #26
0
 def dirDialog11(self):
     self.filename11 = filedialog.askdirectory()
     if (self.filename11):
         self.filepath11.set(self.filename11)
         cf = config_handler.ConfigHandler()
         cf.set_config_value(cf.RECENT_OUTPUT_DIR,self.filename11)   
Пример #27
0
 def saveBookID(self):
     cf = config_handler.ConfigHandler()
     cf.set_config_value(cf.RECENT_BOOK_ID, str(self.bookid.get()))
Пример #28
0
import os
import config_handler

__all__ = ["network_base"]

NETWORK_CONFIG_CATEGORY = "Network"

CONFIG = config_handler.ConfigHandler(NETWORK_CONFIG_CATEGORY)
STRINGS = config_handler.ConfigHandler(NETWORK_CONFIG_CATEGORY, strings=True)

DLL_FILENAME = CONFIG.get(option="dll_file_name")
#DLL_PATH = "{0}\\{1}".format(os.path.dirname(os.path.realpath(__file__)), DLL_FILENAME)
DLL_PATH = r"C:\Users\Guy\Documents\EasyDLP\NetworkLib\Release\network_lib.dll"
Пример #29
0
    lines = getLineFromTextFile(pathIn)
    lineTotal = len(lines)
    if lineTotal == 1 and not lines[0].strip():
        message = 'File ' + word + ' is empty'
    else:
        message = splitHeadWord(lines, word, dirOut)

    return message


if __name__ == "__main__":

    dirIn = 'E:/FULLTEXT/LEXICO/TEXT'
    dirOut = 'E:/FULLTEXT/LEXICO/TEXT2'
    dirLog = 'E:/FULLTEXT/LEXICO/LOG'
    cf = config_handler.ConfigHandler()
    recentFile = cf.get_config_value(cf.RECENT_OPEN_FILE2)
    #print(recentFile)
    fileList = os.listdir(dirIn)
    lastFile = ''
    prefix = 'Lexicon_Second_Run_Log_'
    logData = []
    logPath = getDatedFilePath(prefix, dirLog)
    #print('log path:', logPath)
    timeStamp = getDateStamp()
    message = 'Starting processing at ' + timeStamp
    logData.append(message)
    print(message)

    for item in fileList:
        if (item > recentFile):
Пример #30
0
import network
import network.network_base
import threading
import Queue
import json
import os
import config_handler
import thread

PROTOCOL_CATEGORY = "protocol"
PROTO_CODES = "protocol_codes"
NETWORK_CATEGORY = "network"

# Load config files
CONFIG = network.CONFIG
STRINGS = config_handler.ConfigHandler(conf_type=config_handler.ConfigHandler.STRINGS)
SERVER_CONFIG = config_handler.ConfigHandler(conf_type=config_handler.ConfigHandler.SERVER)

# Load protocol configs
SERVER_HELLO = network.CONFIG.get(PROTOCOL_CATEGORY, "server_hello")
CLIENT_HELLO = network.CONFIG.get(PROTOCOL_CATEGORY, "client_hello")
ADMIN_HELLO = network.CONFIG.get(PROTOCOL_CATEGORY, "admin_hello")
INJECTOR_HELLO = network.CONFIG.get(PROTOCOL_CATEGORY, "injector_hello")

SOCKET_CLOSE_DATA = network.CONFIG.get(PROTOCOL_CATEGORY, "socket_close").decode('string_escape')

# Load proto codes configs
PROTOCOL_STATUS_CODES = {"ok": network.CONFIG.getint(PROTO_CODES, "ok"),
                         "error": network.CONFIG.getint(PROTO_CODES, "error"),
                         "incident_info": network.CONFIG.getint(PROTO_CODES, "incident_info"),
                         "authentication": network.CONFIG.getint(PROTO_CODES, "authentication"),