zztin / ctimer

This is a python implementation of a famous time management technique. CTimer helps you keep track of your productivity during the day, and help you set realistic goals for your day.
Apache License 2.0
0 stars 1 forks source link

Use message box to fix #12 that was not solve in ctimer_db branch #16

Closed zztin closed 4 years ago

zztin commented 4 years ago

(Thanks for sending a pull request! Please fill in the following content to let us know better about this change.)

Types of changes

Please put an x in the box that applies

Description

The messages after a clock finishes are now prompt with tikinter default messagebox and simpledialog, solving the problem previously which the main window keep going while not waiting for response from subwindows.

Steps to Test This Pull Request

Steps to reproduce the behavior:

  1. in concentrationtimer.py: Disable line 30 and enable line 29 temporary for quickly checking results.
  2. launch ctimer in terminal (make sure it was installed with developer mode)
  3. Start the clock and enters a goal
  4. finish the clock
  5. Answers the prompt windows by clicking "no"
  6. Enter a reason in the next window.
  7. Repeat 2-4 and answer yes in the second clock.
  8. terminate ctimer app.
  9. Check stored database at path: ctimer/data/ctimer.db --> drag and drop in https://inloop.github.io/sqlite-viewer/
  10. if the entries you typed are stored correctly, accept the pull request.

Expected behavior

  1. Database is updated as user input.
  2. No errors in command line.

Related Issue

12 #6

tai271828 commented 4 years ago

Right after complete step#6 I got

unable to open database file
Welcome                                                      
2020-07-09 21:56:14.019 GSSpeechServer[10597:10597] No handle for event rport on descriptor 13
2020-07-09 21:56:17.412 GSSpeechServer[10597:10597] No handle for event rport on descriptor 13
2020-07-09 21:56:49.704 GSSpeechServer[10597:10597] No handle for event rport on descriptor 13
unable to open database file                                    
Exception in Tkinter callback                                  
Traceback (most recent call last):                                                                                    
  File "/home/tai271828/.pyenv/versions/3.8.3/lib/python3.8/tkinter/__init__.py", line 1883, in __call__                
    return self.func(*args)                                            
  File "/home/tai271828/.pyenv/versions/3.8.3/lib/python3.8/tkinter/__init__.py", line 804, in callit
    func(*args)
  File "/home/tai271828/work-my-projects/ctimer/ctimer/concentratetimer/concentratetimer.py", line 117, in countdown
    db.db_add_clock_details(self.db_file, self.clock_details)                                 
  File "/home/tai271828/work-my-projects/ctimer/ctimer/concentratetimer/ctimer_db.py", line 24, in db_add_clock_details
    with conn:                                                                                
AttributeError: __enter__

By manually creating a folder data under the project root, we could workaround this issue.

zztin commented 4 years ago

Data path Issue fixed. Ready for pull review.

tai271828 commented 4 years ago

Hi, you pushed your db binary to the repository.

tai271828 commented 4 years ago

Testing looks good. Thanks for the effort!