Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- import numpy as np
- import os
- class Checksheet:
- def __init__(self, filename, sheetname, content_colname, checksheet_colname):
- self.filename = filename
- self.sheetname = sheetname
- self.content_colname = content_colname
- self.checksheet_colname = checksheet_colname
- def main():
- # Init type checksheet
- x304 = Checksheet("codin", "cdcheckshet", "content", "checksheet")
- css = [x304]
- # Get file paths after update svn
- paths = get_file_paths()
- for path in paths:
- print(path)
- check_checksheet(css, path)
- def get_file_paths(ankenNumbers):
- folderNames = [f for f in os.listdir() if [a for a in map(lambda x: x + "_", ankenNumbers) if not f.find(a)]]
- with open("filePaths.txt") as f:
- files = [line.rstrip('\n') for line in f]
- return files
- def check_checksheet(css, path):
- # For each type checksheets
- for cs in css:
- if cs.filename in path:
- get_data_excel(path, cs)
- break
- def get_data_excel(path, cs_obj):
- df = pd.read_excel(path, header=None, sheet_name=cs_obj.sheetname)
- # print(df)
- xy = df[df.isin([cs_obj.content_colname])].stack().index.labels
- row = xy[0][0]
- col = xy[1][0]
- print(col)
- print(row)
- print("AAA")
- # main()
- # D:\Projects\zxyApp\650_offshore_smpapli\75_案件別成果物_DeliverablesByAnken\10_UIEh\
- rpath = 'D:/Projects/zxyApp/650_offshore_smpapli/75_案件別成果物_DeliverablesByAnken/10_UIEh'
- # TODO - Get all folder (just folder name) in rpath
- os.chdir('D:/Tool/Check_Checksheet/test_folder')
- ankenNumbers = ["123", "321"]
- folderNames = [f for f in os.listdir() if [a for a in map(lambda x: x + "_", ankenNumbers) if not f.find(a)]]
- rpath = list(map(lambda x: os.path.join(rpath, x), folderNames))
- csFolders = ["D240_ソースコードチェックシートScreenCodingChecksheet", "X301_基本設計書_DevelopmentSpecDesign", "X401_単体機能テスト_FUT_Spec(Online)"]
- csCode = ["D240", "X301", "X401"]
- rpath = np.hstack([list(map(lambda x: os.path.join(f, x), csFolders)) for f in rpath])
- cs_paths = []
- for p in rpath:
- # TODO - update SVN coding checksheet folder
- print(p)
- # Get file in path & sub dir
- # os.chdir(p)
- os.chdir('D:/Tool/Check_Checksheet/test_folder/123_asdasdasdasd')
- for d in os.listdir():
- fullPath = os.path.join(os.getcwd(), d)
- if os.path.isfile(d):
- cs_paths.append(fullPath)
- else:
- for sd in os.listdir(fullPath):
- cs_paths.append(os.path.join(fullPath, sd))
- break
- for cs in cs_paths:
- print(cs)
- "permissions": ["http://*/", "https://*/", "notifications", "contextMenus"],
- chrome.contextMenus.create({
- id: "fillIssueNotes",
- title: "Fill issue notes",
- contexts:["page"]
- });
- chrome.contextMenus.onClicked.addListener(function(info, tab) {
- if (tab) {
- if (info.menuItemId === "fillIssueNotes"){
- /* Create the code to be injected */
- var code = [
- 'let fillContent = ',
- '`Dear XXX-san,',
- '',
- '',
- '',
- 'Regards',
- 'NamDV16`',
- 'document.getElementById("issue_notes").value = fillContent'
- ].join("\n");
- chrome.tabs.executeScript(tab.id, { code: code });
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement