def start(): print("-------산돌이 v0.1-------") print("기능 소개는 기능, ㄱㄴ을 입력하세요.") inp = '' # 발화 정보를 담는 변수 inp2 = '' # 세부 발화 정보를 담는 변수 randnum = 0 # 다양한 대답을 선택 할 난수를 담을 변수 while 1: #랜덤 변수를 통해서 대답 선택 randnum = random.randint(1, 4) if randnum == 1: print("무엇을 도와드릴까요?") elif randnum == 2: print("무엇이든 물어보세요!") elif randnum == 3: print("어떤 것을 도와드려요?") else: print("무엇이든 말씀하세요!") inp = input() if '기능' in inp or 'ㄱㄴ' in inp: funcText() elif '학식' in inp or 'ㅎㅅ' in inp or '메뉴' in inp or 'ㅁㄴ' in inp or '밥' in inp or 'ㅂ' in inp or '배고' in inp: menu.menu() elif '막차' in inp or 'ㅁㅊ' in inp: station.station() elif '셔틀' in inp or 'ㅅㅌ' in inp: #셔틀은 이미 산돌이에 구현되어있어서 구현 x noFunc() elif '날씨' in inp or 'ㄴㅆ' in inp: wheather.wheather() elif '공지' in inp or 'ㄱㅈ' in inp: notice.notice() elif '게임' in inp or 'ㄱㅇ' in inp: while 1: inp2 = input("롤? 메이플?") if "롤" in inp2 or "ㄹ" in inp2: game.lol() break elif "메이플" in inp2 or "ㅁㅇㅍ" in inp2 or "메이플스토리" in inp2: game.maple() break elif "ㅇㅇ" in inp2 or "응" in inp2: break else: print("무슨 게임 말하는 거에요?? 돌아가겠어요?") elif '산바' in inp or 'ㅅㅂ' in inp: print("이용해줘서 감사해요!") break else: if randnum == 1: print("무슨 말인지 모르겠어요. 좀 더 쉬운 언어로 말씀해주시겠어요?") elif randnum == 2: print("무슨 뜻이에요? 혹시 좀 더 쉬운 단어가 있나요?") elif randnum == 3: print("잘 모르겠어요. 저는 어려운 말은 잘 몰라요.") else: print("제가 잘 모르는 말이에요. 그건 조금 더 공부해올게요.")
def init(self): self.window = gtk.Window() self.window.connect("show", self.show_cb) self.window.set_decorated(False) self.window.set_border_width(0) self.window.set_keep_above(True) fixed = gtk.Fixed() image = gtk.Image() image_file=os.path.join(get_image_file_path(),"splash.png") label = gtk.Label() label.set_use_markup(gtk.TRUE) label.set_markup('<span color="black" size="88000"><b>opvdm</b></span>') label.show() image.set_from_file(image_file) image.show() fixed.put(image, 0, 0) fixed.put(label,40,40) label = gtk.Label() label.set_use_markup(gtk.TRUE) label.set_markup(notice()+"\n"+ver()) label.show() fixed.put(label,40,200) self.window.add(fixed) self.window.set_position(gtk.WIN_POS_CENTER) self.window.show_all() self.window.connect("destroy", self.callback_destroy)
def __init__(self): # QDialog.__init__(self) self.ui = loadUi(os.path.join(get_ui_path(), "about.ui")) self.ui.ver.setText(ver() + "\n" + notice()) self.ui.li.setText("Written by Roderick MacKenzie 2014, published under GPL v2.0") self.ui.show() pixmap = QPixmap(os.path.join(get_image_file_path(), "image.jpg")) self.ui.image.setPixmap(pixmap)
def about_dialog_show(): about = gtk.AboutDialog() about.set_program_name("opvdm") about.set_version("") about.set_copyright("Written by Roderick MacKenzie 2014, published under GPL v2.0") about.set_comments(ver() + "\n" + notice()) about.set_website("http://www.opvdm.com") image = os.path.join(get_image_file_path(), "image.jpg") about.set_logo(gtk.gdk.pixbuf_new_from_file(image)) about.run() about.destroy()
def init(self): self.window = loadUi(os.path.join(get_ui_path(),"splash.ui")) self.window.setWindowFlags(Qt.FramelessWindowHint|Qt.WindowStaysOnTopHint) self.center() self.window.li.setText(notice()+"\n"+version()) self.window.setModal(Qt.WindowModal) self.window.image.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.window.image.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) window_h=self.window.height() window_w=self.window.width() r=random.randint(2, 3) image=QPixmap(os.path.join(get_image_file_path(),"splash"+str(r)+".png")) image.scaledToHeight(window_h) w=image.width() h=image.height() x_max=w-window_h-window_w/2 hour=float(time.strftime("%H"))*60 m=float(time.strftime("%m")) tot=hour+m my_max=float(24*60) value=tot/my_max xpos=int(x_max*value)+window_w/2 print("xpos=",xpos) scene=QGraphicsScene(); scene.setSceneRect(xpos, 0, 0, h) self.window.image.setScene(scene) self.window.show() scene.addPixmap(image); QTimer.singleShot(1500, self.callback_destroy)
from gui_enable import gui_test gui_test() from win_lin import running_on_linux from cal_path import get_image_file_path from cal_path import calculate_paths from cal_path import calculate_paths_init from cal_path import get_share_path from cal_path import set_sim_path calculate_paths_init() calculate_paths() from lock import get_email from notice import notice print(notice()) print("loading.... please wait...") from cal_path import get_lang_path import i18n _ = i18n.language.gettext from cal_path import get_inp_file_path from code_ctrl import enable_betafeatures from code_ctrl import code_ctrl_load from code_ctrl import enable_webupdates #undo from undo import undo_list_class
def __init__(self): QWidget.__init__(self) mul=1.1 self.counts=0 width=459*mul self.setFixedSize(width, 260) self.center() self.view=QGraphicsView(self) self.view.setStyleSheet("QProgressBar { border: 2px solid grey; border-radius: 5px; text-align: center; }") self.view.setFixedSize(width+2+2,261) self.view.move(-2,0) self.setWindowFlags(Qt.FramelessWindowHint|Qt.WindowStaysOnTopHint) self.li=QLabel("ver",self) self.li.move(30,170) self.font = QFont() self.font.setFamily('DejaVu Sans') self.font.setBold(True) self.font.setStyleHint(QFont.Monospace) self.font.setFixedPitch(True) self.font.setPointSize(int(72)) self.terminals=[] self.process=[] self.gpvdm=QLabel("gpvdm",self) self.gpvdm.setFont(self.font) self.gpvdm.move(80,40) self.li.setText(notice()+"\n"+version()) self.view.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.view.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) window_h=self.height() window_w=self.width() QTimer.singleShot(2000, self.callback_destroy) files=glob.glob(os.path.join(get_image_file_path(),"splash","*.jpg")) files.extend(glob.glob(os.path.join(get_image_file_path(),"splash","*.png"))) number=time.localtime().tm_yday number=number % len(files) if number>=len(files[number]): number=0 image_file=files[number] image_path=os.path.join(get_image_file_path(),"splash",image_file) if os.path.isfile(image_path): image=QPixmap(image_path) image.scaledToHeight(window_h) w=image.width() h=image.height() x_max=w-window_h-window_w/2 hour=float(time.strftime("%H"))*60 m=float(time.strftime("%m")) tot=hour+m my_max=float(24*60) value=tot/my_max xpos=int(x_max*value)+window_w/2 scene=QGraphicsScene(); scene.setSceneRect(xpos, 0, 0, h) self.view.setScene(scene) scene.addPixmap(image); else: print("Image not found",image_path) self.pbar = QProgressBar(self) self.pbar.setGeometry(0, 261-20, width-5, 15) #self.pbar.move(50,150) self.show()
from export_materials import export_materials if running_on_linux()==True: import dbus from dbus.mainloop.glib import DBusGMainLoop import pynotify if os.geteuid() == 0: exit(_("Don't run me as root!!")) else: from windows_pipe import win_pipe print notice() gobject.threads_init() def set_active_name(combobox, name): liststore = combobox.get_model() for i in xrange(len(liststore)): if liststore[i][0] == name: combobox.set_active(i) class opvdm_main_window(gobject.GObject): icon_theme = gtk.icon_theme_get_default() plot_after_run=False plot_after_run_file=""
from error_han import error_han from plot_dlg import plot_dlg_class from gui_util import yes_no_dlg if running_on_linux()==True: import dbus from dbus.mainloop.pyqt5 import DBusQtMainLoop if os.geteuid() == 0: exit(_("Don't run me as root!!")) else: from windows_pipe import win_pipe print(notice()) #gobject.threads_init() def set_active_name(combobox, name): liststore = combobox.get_model() for i in range(0,len(liststore)): if liststore[i][0] == name: combobox.set_active(i) class gpvdm_main_window(QMainWindow): plot_after_run=False plot_after_run_file="" scan_window=None
def do_import(): global new_simulation global dlg_export global device_lib_class global cool_menu global equation global webbrowser global ver_check_compatibility global update_thread global update_now global gen_workbook global plot_dlg_class global yes_no_dlg global isfiletype global dbus global DBusQtMainLoop global win_pipe global QTabWidget global ribbon global error_dlg global to_native_path global get_sim_path global clone_materials global wpos_load global global_object_run global check_sim_exists #qt from PyQt5.QtWidgets import QTextEdit, QAction from PyQt5.QtGui import QIcon from PyQt5.QtCore import QSize, Qt, QFile, QIODevice from PyQt5.QtWidgets import QWidget, QSizePolicy, QVBoxLayout, QHBoxLayout, QPushButton, QDialog, QFileDialog, QToolBar, QMessageBox, QLineEdit, QToolButton from icon_lib import icons_load icons_load() #windows from new_simulation import new_simulation from dlg_export import dlg_export from device_lib import device_lib_class from cool_menu import cool_menu from equation import equation #python modules import webbrowser #ver from ver import ver_check_compatibility #updates from update import update_thread from update import update_now from workbook import gen_workbook from plot_dlg import plot_dlg_class from gui_util import yes_no_dlg from util import isfiletype if running_on_linux() == True: import dbus from dbus.mainloop.pyqt5 import DBusQtMainLoop if os.geteuid() == 0: exit(_("Don't run me as root!!")) else: from windows_pipe import win_pipe print(notice()) #gobject.threads_init() from PyQt5.QtWidgets import QTabWidget from ribbon import ribbon from error_dlg import error_dlg from cal_path import to_native_path from cal_path import get_sim_path from clone import clone_materials from window_list import wpos_load from global_objects import global_object_run from check_sim_exists import check_sim_exists