-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
79 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from tkinter import * | ||
import os | ||
from os.path import isfile | ||
|
||
class GUI: | ||
title = 'ESAM' | ||
icon = 'images' + os.sep + 'icon.ico' | ||
size = '800x800+400+400' | ||
|
||
def __init__(self): | ||
window = Tk() | ||
window.title(self.title) | ||
if isfile(self.icon): | ||
window.iconbitmap(self.icon) | ||
window.geometry(self.size) | ||
|
||
# top buttons | ||
serenity_btn = Button(text='国服',font=('bold', 25), command=()) | ||
serenity_btn.place(relx=0.2, rely=0.02, relwidth=0.15, height=50) | ||
tranquility_btn = Button(text='欧服',font=('bold', 25), command=()) | ||
tranquility_btn.place(relx=0.65, rely=0.02, relwidth=0.15, height=50) | ||
|
||
window.mainloop() | ||
|
||
gui = GUI() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import os | ||
from os import listdir | ||
from pathlib import Path | ||
import esi | ||
import time | ||
|
||
class SettingFilesReader: | ||
# Mac | ||
root = '/Users/nick' | ||
# root = Path.home().__str__() + '\AppData\Local\CCP\EVE\\' | ||
server = '' | ||
dirs = [] | ||
character = [] | ||
|
||
def __init__(self, server): | ||
self.server = server | ||
if server == 'Tranquility': | ||
# self.dirs = [(root_path + f) for f in listdir(root_path) if f.endswith('eve_sharedcache_tq_tranquility')] | ||
# Mac path, for dev purpose | ||
self.dirs = [(self.root + f) for f in listdir(self.root) if f.endswith('EVESettings')] | ||
elif server == 'Serenity': | ||
self.dirs = [(self.root + f) for f in listdir(self.root) if f.endswith('eve_sharedcache_serenity_serenity.evepc.163.com')] | ||
else: | ||
print('Invalid server name') | ||
|
||
def getDirs(self): | ||
return self.dirs | ||
|
||
def readCharacters(self, path): | ||
char_prefix = 'core_char_' | ||
user_prefix = 'core_user_' | ||
|
||
characters = [] # [(id, name)] | ||
users = [] # [(id, last_mod_time)] | ||
|
||
# is directory exsits | ||
directory = os.path.join(path, 'settings_Default') | ||
if not os.path.isdir(directory): | ||
return [], [] | ||
|
||
esiReader = esi.EsiReader(self.server) | ||
for file in os.listdir(directory): | ||
filename = os.fsdecode(file) | ||
id = filename.split('.')[0].split('_')[-1] | ||
if id.isnumeric(): | ||
if filename.startswith(char_prefix): | ||
name = esiReader.getCharacterName(id) | ||
characters.append((id, name)) | ||
elif filename.startswith(user_prefix): | ||
mod_time = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(os.path.getmtime(directory + os.sep + file))) | ||
users.append((id, mod_time)) | ||
|
||
return characters, users |
Empty file.