Skip to content

Commit

Permalink
Merge pull request #63 from Beebeeoii/release-v2.0.2
Browse files Browse the repository at this point in the history
Release v2.0.2
  • Loading branch information
Jia Wei Lee authored Aug 14, 2022
2 parents 294b0ce + 1018353 commit 63f0c39
Show file tree
Hide file tree
Showing 35 changed files with 475 additions and 245 deletions.
4 changes: 2 additions & 2 deletions FyneApp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Website = "https://github.com/beebeeoii/lominus"
Icon = "./assets/app-icon.png"
Name = "Lominus"
ID = "com.beebeeoii.lominus"
Version = "2.0.1"
Build = 200
Version = "2.0.2"
Build = 202
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</p>

<p align="center">
<img src="https://img.shields.io/badge/Lominus-v2.0.1-blueviolet" />
<img src="https://img.shields.io/badge/Lominus-v2.0.2-blueviolet" />
<img src="https://img.shields.io/github/downloads/beebeeoii/lominus/total" />
<img src="https://img.shields.io/github/go-mod/go-version/beebeeoii/lominus" />
<a href="https://pkg.go.dev/github.com/beebeeoii/lominus">
Expand Down Expand Up @@ -110,7 +110,7 @@ sudo make install

### Prerequisites <a name="getting-started-building-prerequisites">

1. [Golang](https://go.dev/dl/)
1. [Golang >= 1.18](https://go.dev/dl/)

2. `gcc`

Expand All @@ -126,7 +126,11 @@ sudo make install

### Build <a name="getting-started-building-build">

1. Ensure Go is set in you system env var
1. Ensure `GOPATH` is set in your system env

``` bash
export GOPATH=$HOME/go
```

2. Install dependencies in the directory where you cloned

Expand All @@ -137,18 +141,20 @@ sudo make install
3. Install [fyne](https://developer.fyne.io/index.html)

``` bash
go get fyne.io/fyne/v2/cmd/fyne
go install fyne.io/fyne/v2/cmd/fyne@latest
```

4. Finally, build and compile
4. Ensure that your system `PATH` contains `$GOPATH/bin` before building.

``` bash
export PATH=$GOPATH/bin:$PATH
fyne package
```

## API <a name="getting-started-api">

Lominus can also be used as an API. Please visit [documentations](https://pkg.go.dev/github.com/beebeeoii/lominus) for more details.
However, do note that the documentations are lacking after v2.0.0 update due to lack of time :(. This should be fixed in due time.

### Example: Retrieving your modules <a name="getting-started-api-example">

Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/juju/fslock v0.0.0-20160525022230-4d5c94c67b4b
github.com/mitchellh/mapstructure v1.5.0
github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.8.0
github.com/sqweek/dialog v0.0.0-20220809060634-e981b270ebbf
)

require (
Expand All @@ -27,6 +27,7 @@ require (
)

require (
github.com/TheTitanrain/w32 v0.0.0-20180517000239-4f5cfb03fabf // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fredbi/uri v0.0.0-20181227131451-3dcfdacbaaf3 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
Expand All @@ -37,6 +38,7 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/srwiley/oksvg v0.0.0-20220128195007-1f435e4c2b44 // indirect
github.com/srwiley/rasterx v0.0.0-20220128185129-2efea2b9ea41 // indirect
github.com/stretchr/testify v1.8.0 // indirect
github.com/yuin/goldmark v1.4.10 // indirect
golang.org/x/image v0.0.0-20220601225756-64ec528b34cd // indirect
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ fyne.io/systray v1.10.1-0.20220621085403-9a2652634e93/go.mod h1:oM2AQqGJ1AMo4nNq
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/TheTitanrain/w32 v0.0.0-20180517000239-4f5cfb03fabf h1:FPsprx82rdrX2jiKyS17BH6IrTmUBYqZa/CXT4uvb+I=
github.com/TheTitanrain/w32 v0.0.0-20180517000239-4f5cfb03fabf/go.mod h1:peYoMncQljjNS6tZwI9WVyQB3qZS6u79/N3mBOcnd3I=
github.com/akavel/rsrc v0.10.2/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
Expand Down Expand Up @@ -266,6 +268,8 @@ github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t6
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns=
github.com/sqweek/dialog v0.0.0-20220809060634-e981b270ebbf h1:pCxn3BCfu8n8VUhYl4zS1BftoZoYY0J4qVF3dqAQ4aU=
github.com/sqweek/dialog v0.0.0-20220809060634-e981b270ebbf/go.mod h1:/qNPSY91qTz/8TgHEMioAUc6q7+3SOybeKczHMXFcXw=
github.com/srwiley/oksvg v0.0.0-20200311192757-870daf9aa564/go.mod h1:afMbS0qvv1m5tfENCwnOdZGOF8RGR/FsZ7bvBxQGZG4=
github.com/srwiley/oksvg v0.0.0-20220128195007-1f435e4c2b44 h1:XPYXKIuH/n5zpUoEWk2jWV/SjEMNYmqDYmTgbjmhtaI=
github.com/srwiley/oksvg v0.0.0-20220128195007-1f435e4c2b44/go.mod h1:cNQ3dwVJtS5Hmnjxy6AgTPd0Inb3pW05ftPSX7NZO7Q=
Expand Down
4 changes: 2 additions & 2 deletions internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (

appDir "github.com/beebeeoii/lominus/internal/app/dir"
appPref "github.com/beebeeoii/lominus/internal/app/pref"
appConstants "github.com/beebeeoii/lominus/internal/constants"
"github.com/beebeeoii/lominus/internal/file"
logs "github.com/beebeeoii/lominus/internal/log"
"github.com/beebeeoii/lominus/internal/lominus"
)

// Init initialises and ensures log and preference files that Lominus requires are available.
Expand Down Expand Up @@ -65,7 +65,7 @@ func Init() error {
}

// TODO Consider moving this to its own module in the future.
gradesPath := filepath.Join(baseDir, lominus.GRADES_FILE_NAME)
gradesPath := filepath.Join(baseDir, appConstants.GRADES_FILE_NAME)

if !file.Exists(gradesPath) {
gradeFileErr := file.EncodeStructToFile(gradesPath, time.Now())
Expand Down
6 changes: 3 additions & 3 deletions internal/app/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"path/filepath"

appDir "github.com/beebeeoii/lominus/internal/app/dir"
"github.com/beebeeoii/lominus/internal/lominus"
appConstants "github.com/beebeeoii/lominus/internal/constants"
)

// GetJwtPath returns the file path to user's JWT data.
Expand All @@ -17,7 +17,7 @@ func GetTokensPath() (string, error) {
return jwtPath, retrieveBaseDirErr
}

jwtPath = filepath.Join(baseDir, lominus.TOKENS_FILE_NAME)
jwtPath = filepath.Join(baseDir, appConstants.TOKENS_FILE_NAME)

return jwtPath, nil
}
Expand All @@ -31,7 +31,7 @@ func GetCredentialsPath() (string, error) {
return credentialsPath, retrieveBaseDirErr
}

credentialsPath = filepath.Join(baseDir, lominus.CREDENTIALS_FILE_NAME)
credentialsPath = filepath.Join(baseDir, appConstants.CREDENTIALS_FILE_NAME)

return credentialsPath, nil
}
4 changes: 2 additions & 2 deletions internal/app/dir/dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"path/filepath"

"github.com/beebeeoii/lominus/internal/lominus"
appConstants "github.com/beebeeoii/lominus/internal/constants"
)

// GetBaseDir returns the directory where config files for Lominus will be stored in.
Expand All @@ -23,7 +23,7 @@ func GetBaseDir() (string, error) {
return baseDir, err
}

baseDir = filepath.Join(userConfigDir, lominus.APP_NAME)
baseDir = filepath.Join(userConfigDir, appConstants.APP_NAME)

return baseDir, nil
}
4 changes: 2 additions & 2 deletions internal/app/integrations/telegram/telegram.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"path/filepath"

appDir "github.com/beebeeoii/lominus/internal/app/dir"
"github.com/beebeeoii/lominus/internal/lominus"
appConstants "github.com/beebeeoii/lominus/internal/constants"
)

// GetTelegramInfoPath returns the file path to user's telegram config file.
Expand All @@ -17,7 +17,7 @@ func GetTelegramInfoPath() (string, error) {
return telegramInfoPath, retrieveBaseDirErr
}

telegramInfoPath = filepath.Join(baseDir, lominus.TELEGRAM_FILE_NAME)
telegramInfoPath = filepath.Join(baseDir, appConstants.TELEGRAM_FILE_NAME)

return telegramInfoPath, nil
}
4 changes: 2 additions & 2 deletions internal/app/lock/lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"path/filepath"

appDir "github.com/beebeeoii/lominus/internal/app/dir"
"github.com/beebeeoii/lominus/internal/lominus"
appConstants "github.com/beebeeoii/lominus/internal/constants"
)

// GetLockPath returns the file path to Lominus lock file.
Expand All @@ -17,7 +17,7 @@ func GetLockPath() (string, error) {
return lockPath, retrieveBaseDirErr
}

lockPath = filepath.Join(baseDir, lominus.LOCK_FILE_NAME)
lockPath = filepath.Join(baseDir, appConstants.LOCK_FILE_NAME)

return lockPath, nil
}
6 changes: 3 additions & 3 deletions internal/app/pref/pref.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"path/filepath"

appDir "github.com/beebeeoii/lominus/internal/app/dir"
appConstants "github.com/beebeeoii/lominus/internal/constants"
"github.com/beebeeoii/lominus/internal/file"
"github.com/beebeeoii/lominus/internal/lominus"
)

const PREFERENCES_FILE_NAME = lominus.PREFERENCES_FILE_NAME
const PREFERENCES_FILE_NAME = appConstants.PREFERENCES_FILE_NAME

// Preferences struct describes the data being stored in the user's preferences file.
type Preferences struct {
Expand All @@ -27,7 +27,7 @@ func GetPreferencesPath() (string, error) {
return preferencesPath, retrieveBaseDirErr
}

preferencesPath = filepath.Join(baseDir, lominus.PREFERENCES_FILE_NAME)
preferencesPath = filepath.Join(baseDir, appConstants.PREFERENCES_FILE_NAME)

return preferencesPath, nil
}
Expand Down
7 changes: 4 additions & 3 deletions internal/lominus/lominus.go → internal/constants/lominus.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// Package lominus provides app config constants.
package lominus
// Package constants provide constants to be used internally within Lominus (not exported as API)
// such as UI constants.
package constants

const APP_NAME = "Lominus"
const APP_ID = "com.lominus.beebeeoii"
const APP_VERSION = "2.0.1"
const APP_VERSION = "2.0.2"

const LOCK_FILE_NAME = "lominus.lock"

Expand Down
4 changes: 3 additions & 1 deletion internal/constants/ui.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package constants provide constants to be used internally within Lominus (not exported as API)
// such as UI constants.
package constants

const (
Expand Down Expand Up @@ -58,7 +60,7 @@ const (
TELEGRAM_DEFAULT_TEST_MESSAGE = "Thank you for using Lominus! You have succesfully integrated Telegram with Lominus!\n\nBy integrating Telegram with Lominus, you will be notified of the following whenever Lominus polls for new update based on the intervals set:\n💥 new grades releases\n💥 new announcements (TBC)"
TELEGRAM_TESTING_MESSAGE = "Please wait while we send you a test message..."
TELEGRAM_TESTING_SUCCESSFUL_MESSAGE = "Telegram integration successful!"
TELEGRAM_TESTING_FAILED_MESSAGE = "Telegram integration failed. Please ensure that you have chatted with your bot before."
TELEGRAM_TESTING_FAILED_MESSAGE = "Telegram integration failed.\nPlease ensure that you have chatted with your bot before."
SAVE_TELEGRAM_DATA_TEXT = "Save Telegram Info"

// General
Expand Down
Loading

0 comments on commit 63f0c39

Please sign in to comment.