Skip to content

Commit

Permalink
various bugs... images are agin out... so gexf file (in appearance)
Browse files Browse the repository at this point in the history
  • Loading branch information
Patent2net committed Jun 8, 2022
1 parent ab444a2 commit cd5305a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 18 deletions.
8 changes: 5 additions & 3 deletions Patent2Net/Interface2.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
nbFam = len(data2['brevets'])
else: # Retrocompatibility
print("No Families. please use gather them")
# if 'Fusion' in data.keys()with open( ResultBiblioPath+'//Families'+ndf, 'r') as ficBib:
# if 'Fusion' in data.keys()with open( ResultBiblioPath+'/Families'+ndf, 'r') as ficBib:
# data2 = cPickle.load(ficBib)

else:
Expand Down Expand Up @@ -95,9 +95,11 @@ def generateTotal(content):
for content in ['FamiliesAbstract', 'FamiliesClaims', 'FamiliesDescription']:
totalsPerFamilyType.append(generateTotal(content))

outfile = GlobalPath + '//' + ndf + '.html'
outfile = GlobalPath + '/' + ndf + '.html'
print('Writing "{outfile}"'.format(outfile=outfile))

print(dir(configFile.show()))

RenderTemplate(
"ModeleContenuIndex2.html",
outfile,
Expand Down Expand Up @@ -136,7 +138,7 @@ def generateTotal(content):
)


outfile = GlobalPath + '//' + ndf+'//'+ndf+'Carrot.html'
outfile = GlobalPath + '/' + ndf+'/'+ndf+'Carrot.html'
ModeleCarrot = "carrot2.html"
RenderTemplate(
"carrot2.html",
Expand Down
29 changes: 17 additions & 12 deletions Patent2Net/P2N_Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class P2NConfig:
def __init__(self, file):

# Global path for results
self.GlobalPath = '..//DATA'
self.GlobalPath = '../DATA'
self.file = file

# Initiate all empty attributes
Expand Down Expand Up @@ -105,26 +105,28 @@ def __init__(self, file):
def readInputFile(self):
if len(sys.argv) > 1:
for arg in sys.argv:
self.file = arg
if ".cql" in arg.lower():
return open(arg, "r").readlines()

if self.file != None:
if ".cql" in self.file.lower():
file_path = os.path.dirname(os.path.realpath(__file__)) + '/../RequestsSets/' + self.file
file_path = '../RequestsSets/' + self.file
return open(file_path, "r").readlines()

return open("..//requete.cql", "r").readlines()
return open("../requete.cql", "r").readlines()

def generatePaths(self):
self.ResultPath = os.path.normpath(os.path.join(self.GlobalPath, self.ndf)).replace('\\','/')
self.ResultListPath = os.path.normpath(self.ResultPath + '//PatentLists').replace('\\','/')
self.ResultBiblioPath = os.path.normpath(self.ResultPath + '//PatentBiblios').replace('\\','/')
self.ResultContentsPath = os.path.normpath(self.ResultPath + '//PatentContents').replace('\\','/')
self.temporPath = os.path.normpath(self.ResultPath + '//tempo').replace('\\','/')
self.ResultAbstractPath = os.path.normpath(self.ResultContentsPath + '//Abstract').replace('\\','/')
self.ResultFamiliesAbstractPath = os.path.normpath(self.ResultContentsPath + '//FamiliesAbstract').replace('\\','/')
self.ResultGephiPath = os.path.normpath(self.ResultPath + '//GephiFiles').replace('\\','/')
self.ResultPathImages = os.path.normpath(self.ResultPath + '//PatentImages').replace('\\','/')
self.ResultClusterPath = os.path.normpath(self.ResultContentsPath+'//Metrics').replace('\\','/')
self.ResultListPath = os.path.normpath(self.ResultPath + '/PatentLists').replace('\\','/')
self.ResultBiblioPath = os.path.normpath(self.ResultPath + '/PatentBiblios').replace('\\','/')
self.ResultContentsPath = os.path.normpath(self.ResultPath + '/PatentContents').replace('\\','/')
self.temporPath = os.path.normpath(self.ResultPath + '/tempo').replace('\\','/')
self.ResultAbstractPath = os.path.normpath(self.ResultContentsPath + '/Abstract').replace('\\','/')
self.ResultFamiliesAbstractPath = os.path.normpath(self.ResultContentsPath + '/FamiliesAbstract').replace('\\','/')
self.ResultGephiPath = os.path.normpath(self.ResultPath + '/GephiFiles').replace('\\','/')
self.ResultPathImages = os.path.normpath(self.ResultPath + '/PatentImages').replace('\\','/')
self.ResultClusterPath = os.path.normpath(self.ResultContentsPath+'/Metrics').replace('\\','/')
for path in [
self.ResultListPath,
self.ResultBiblioPath,
Expand All @@ -150,6 +152,9 @@ def getBoolean(self, line):
else:
return False

def show(self):
for cle in self.__dict__.keys():
print (cle, " -->" , self .__dict__[cle])

def LoadConfig(file = None):
return P2NConfig(file)
8 changes: 5 additions & 3 deletions Patent2Net/app/dex.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
"in_progress": [],
"done": []
}
dex_location = os.path.dirname(os.path.realpath(__file__)) + '/../../dex.json'
dex_location = '../dex.json' # os.path.dirname(os.path.realpath(__file__)) +
print(dex_location)
#print ('youp ', os.path.dirname(os.path.realpath(__file__)))


global_progress = {}
Expand All @@ -52,7 +53,7 @@ def read_dex():
update_global_progress(in_progress_elmt)

except IOError:
print("WRITE DEFAULT")
print("¨pb dex.jdon file")
write_dex()

def write_dex():
Expand Down Expand Up @@ -149,7 +150,8 @@ def set_done(directory):

global dex
normalize()

#print("coucou")
#print(dex)
in_progress = dex["in_progress"]
done = dex["done"]

Expand Down

0 comments on commit cd5305a

Please sign in to comment.