Diff
checker
テキスト
テキスト
画像
ドキュメント
Excel
フォルダ
Legal
Enterprise
デスクトップ
料金
ログイン
Diffchecker デスクトップのダウンロード
テキスト比較
2 つのテキスト ファイルの違いを見つける
ツール
履歴
ライブエディター
未変更行を折りたたむ
折り返しなし
レイアウト
分割
統合
比較精度
スマート
単語
文字
シンタックスハイライト
構文を選択
無視
テキスト変換
最初の差分へ移動
入力を編集
Diffchecker Desktop
Diffcheckerを実行する最も安全な方法。Diffchecker Desktopアプリを入手:あなたの差分はコンピューターから出ることはありません!
Desktopを入手
Untitled diff
作成日
8 年前
差分は期限切れになりません
クリア
エクスポート
共有
説明
33 削除
行
合計
削除
文字
合計
削除
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
100 行
すべてコピー
33 追加
行
合計
追加
文字
合計
追加
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
100 行
すべてコピー
#!/usr/bin/python3
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
from PyQt5.QtWidgets import (QWidget, QLabel,
from PyQt5.QtWidgets import (QWidget, QLabel,
QComboBox, QApplication)
QComboBox, QApplication)
import sys
import sys
import ovirtsdk4 as sdk
import ovirtsdk4 as sdk
import ovirtsdk4.types as types
import ovirtsdk4.types as types
CONN = None
CONN = None
def get_connection():
def get_connection():
global CONN
global CONN
if CONN:
if CONN:
return CONN
return CONN
CONN = sdk.Connection(
CONN = sdk.Connection(
url='https://localhost.somedomain.intern/ovirt-engine/api',
url='https://localhost.somedomain.intern/ovirt-engine/api',
username='admin@internal',
username='admin@internal',
password='somepass',
password='somepass',
insecure=True,
insecure=True,
)
)
return CONN
return CONN
def get_hosts():
def get_hosts():
connection = get_connection()
connection = get_connection()
コピー
コピー済み
コピー
コピー済み
try:
host_service = connection.system_service().hosts_service()
host_service = connection.system_service().hosts_service()
hosts = host_service.list()
hosts = host_service.list()
コピー
コピー済み
コピー
コピー済み
return [host.name for host in hosts]
return [host.name for host in hosts]
except: pass
#connection.close()
def get_vms():
def get_vms():
コピー
コピー済み
コピー
コピー済み
connection = get_connection()
connection = get_connection()
コピー
コピー済み
コピー
コピー済み
vms_service = connection.system_service().vms_service()
vms_service = connection.system_service().vms_service()
コピー
コピー済み
コピー
コピー済み
vms = vms_service.list()
vms = vms_service.list()
disks_service = connection.system_service().disks_service()
disks_service = connection.system_service().disks_service()
if len(vms) > 0:
if len(vms) > 0:
for virtual_machine in vms:
for virtual_machine in vms:
vm_service = vms_service.vm_service(virtual_machine.id)
vm_service = vms_service.vm_service(virtual_machine.id)
コピー
コピー済み
コピー
コピー済み
try:
return [virtual_machine.name for virtual_machine in vms]
return [virtual_machine.name for virtual_machine in vms]
except: pass
# connection.close()
コピー
コピー済み
コピー
コピー済み
def get_
vm_
host
(
):
def get_
host_vms(
host
_name
):
connection = get_connection()
connection = get_connection()
コピー
コピー済み
コピー
コピー済み
host_service = connection.system_service().hosts_service()
vms_service = connection.system_service().vms_service()
hosts = host_service.list()
vms = vms_service.list(search=host
_
name, case_sensitive=False)
for host in hosts:
vms_service = connection.system_service().vms_service()
return [vm.name for vm in vms]
vms = vms_service.list(search=host
.
name, case_sensitive=False)
return [vm.name for vm in vms]
def get_all_vms():
vms = {}
for host_name in get_hosts:
vms[host_name] = get_host_vms(host_name)
return vms
class Example(QWidget):
class Example(QWidget):
def __init__(self):
def __init__(self):
super().__init__()
super().__init__()
self.initUI()
self.initUI()
def initUI(self):
def initUI(self):
self.lbl = QLabel("Select a Host", self)
self.lbl = QLabel("Select a Host", self)
コピー
コピー済み
コピー
コピー済み
combo = QComboBox(self)
self.
combo = QComboBox(self)
selectvm = QComboBox(
self
)
self
.
combo.addItem("Select a Host")
combo.addItem("Select a Host")
self.
combo.addItems(get_hosts())
combo.addItems(get_hosts())
self.
combo.move(50, 50)
combo.move(50, 50)
self.combo.activated[str].connect(self.onActivated)
self.lbl.move(50, 150)
self.lbl.move(50, 150)
コピー
コピー済み
コピー
コピー済み
selectvm.addItems(get_vm_host())
self.selectvm = QComboBox(self)
sel
ectvm.move(50, 100)
self.
selectvm.addItems(get_vm_host())
sel
f.sel
ectvm.move(50, 100)
self.lbl.move(10, 250)
self.lbl.move(10, 250)
コピー
コピー済み
コピー
コピー済み
combo.activated[str].connect(self.onActivated)
self.setGeometry(300, 500, 600, 400)
self.setGeometry(300, 500, 600, 400)
self.setWindowTitle('VM migration tool')
self.setWindowTitle('VM migration tool')
self.show()
self.show()
コピー
コピー済み
コピー
コピー済み
def onActivated(self,
text
):
def onActivated(self,
host_name
):
self.lbl.setText(
host_name
)
self.lbl.setText(
text
)
self.lbl.adjustSize()
self.lbl.adjustSize()
コピー
コピー済み
コピー
コピー済み
self.selectvm.clear()
self.selectvm.addItems(get_host_vms(host_name))
if __name__ == '__main__':
if __name__ == '__main__':
app = QApplication(sys.argv)
app = QApplication(sys.argv)
ex = Example()
ex = Example()
sys.exit(app.exec_())
sys.exit(app.exec_())
保存された差分
原文
ファイルを開く
#!/usr/bin/python3 # -*- coding: utf-8 -*- from PyQt5.QtWidgets import (QWidget, QLabel, QComboBox, QApplication) import sys import ovirtsdk4 as sdk import ovirtsdk4.types as types CONN = None def get_connection(): global CONN if CONN: return CONN CONN = sdk.Connection( url='https://localhost.somedomain.intern/ovirt-engine/api', username='admin@internal', password='somepass', insecure=True, ) return CONN def get_hosts(): connection = get_connection() try: host_service = connection.system_service().hosts_service() hosts = host_service.list() return [host.name for host in hosts] except: pass #connection.close() def get_vms(): connection = get_connection() vms_service = connection.system_service().vms_service() vms = vms_service.list() disks_service = connection.system_service().disks_service() if len(vms) > 0: for virtual_machine in vms: vm_service = vms_service.vm_service(virtual_machine.id) try: return [virtual_machine.name for virtual_machine in vms] except: pass # connection.close() def get_vm_host(): connection = get_connection() host_service = connection.system_service().hosts_service() hosts = host_service.list() for host in hosts: vms_service = connection.system_service().vms_service() vms = vms_service.list(search=host.name, case_sensitive=False) return [vm.name for vm in vms] class Example(QWidget): def __init__(self): super().__init__() self.initUI() def initUI(self): self.lbl = QLabel("Select a Host", self) combo = QComboBox(self) selectvm = QComboBox(self) combo.addItem("Select a Host") combo.addItems(get_hosts()) combo.move(50, 50) self.lbl.move(50, 150) selectvm.addItems(get_vm_host()) selectvm.move(50, 100) self.lbl.move(10, 250) combo.activated[str].connect(self.onActivated) self.setGeometry(300, 500, 600, 400) self.setWindowTitle('VM migration tool') self.show() def onActivated(self, text): self.lbl.setText(text) self.lbl.adjustSize() if __name__ == '__main__': app = QApplication(sys.argv) ex = Example() sys.exit(app.exec_())
変更されたテキスト
ファイルを開く
#!/usr/bin/python3 # -*- coding: utf-8 -*- from PyQt5.QtWidgets import (QWidget, QLabel, QComboBox, QApplication) import sys import ovirtsdk4 as sdk import ovirtsdk4.types as types CONN = None def get_connection(): global CONN if CONN: return CONN CONN = sdk.Connection( url='https://localhost.somedomain.intern/ovirt-engine/api', username='admin@internal', password='somepass', insecure=True, ) return CONN def get_hosts(): connection = get_connection() host_service = connection.system_service().hosts_service() hosts = host_service.list() return [host.name for host in hosts] def get_vms(): connection = get_connection() vms_service = connection.system_service().vms_service() vms = vms_service.list() disks_service = connection.system_service().disks_service() if len(vms) > 0: for virtual_machine in vms: vm_service = vms_service.vm_service(virtual_machine.id) return [virtual_machine.name for virtual_machine in vms] def get_host_vms(host_name): connection = get_connection() vms_service = connection.system_service().vms_service() vms = vms_service.list(search=host_name, case_sensitive=False) return [vm.name for vm in vms] def get_all_vms(): vms = {} for host_name in get_hosts: vms[host_name] = get_host_vms(host_name) return vms class Example(QWidget): def __init__(self): super().__init__() self.initUI() def initUI(self): self.lbl = QLabel("Select a Host", self) self.combo = QComboBox(self) self.combo.addItem("Select a Host") self.combo.addItems(get_hosts()) self.combo.move(50, 50) self.combo.activated[str].connect(self.onActivated) self.lbl.move(50, 150) self.selectvm = QComboBox(self) self.selectvm.addItems(get_vm_host()) self.selectvm.move(50, 100) self.lbl.move(10, 250) self.setGeometry(300, 500, 600, 400) self.setWindowTitle('VM migration tool') self.show() def onActivated(self, host_name): self.lbl.setText(host_name) self.lbl.adjustSize() self.selectvm.clear() self.selectvm.addItems(get_host_vms(host_name)) if __name__ == '__main__': app = QApplication(sys.argv) ex = Example() sys.exit(app.exec_())
違いを見つける