|
46 | 46 | # MAGIC
|
47 | 47 | # MAGIC def getWorkingDir() -> str:
|
48 | 48 | # MAGIC import re
|
49 |
| -# MAGIC langType = "p" # for python |
50 | 49 | # MAGIC lessonName = re.sub("[^a-zA-Z0-9]", "_", getLessonName())
|
51 | 50 | # MAGIC moduleName = re.sub(r"[^a-zA-Z0-9]", "_", getModuleName())
|
52 | 51 | # MAGIC userhome = getUserhome()
|
53 |
| -# MAGIC return f"{userhome}/{moduleName}/{lessonName}/{langType}".replace("__", "_").replace("__", "_").replace("__", "_").replace("__", "_").lower() |
| 52 | +# MAGIC return f"{userhome}/dbacademy/{moduleName}/{lessonName}/".replace("__", "_").replace("__", "_").replace("__", "_").replace("__", "_").lower() |
54 | 53 | # MAGIC
|
55 | 54 | # MAGIC ############################################
|
56 | 55 | # MAGIC # USER DATABASE FUNCTIONS
|
57 | 56 | # MAGIC ############################################
|
58 | 57 | # MAGIC
|
59 | 58 | # MAGIC def getDatabaseName(username:str, moduleName:str, lessonName:str) -> str:
|
60 | 59 | # MAGIC import re
|
61 |
| -# MAGIC user = re.sub("[^a-zA-Z0-9]", "", username) |
| 60 | +# MAGIC user = re.sub("[^a-zA-Z0-9]", "_", username) |
62 | 61 | # MAGIC module = re.sub("[^a-zA-Z0-9]", "_", moduleName)
|
63 | 62 | # MAGIC lesson = re.sub("[^a-zA-Z0-9]", "_", lessonName)
|
64 |
| -# MAGIC langType = "py" # for python |
65 |
| -# MAGIC databaseName = f"{user}_{module}_{lesson}_{langType}".lower() |
| 63 | +# MAGIC databaseName = f"dbacademy_{user}_{module}_{lesson}".replace("__", "_").replace("__", "_").replace("__", "_").replace("__", "_").lower() |
66 | 64 | # MAGIC return databaseName
|
67 | 65 | # MAGIC
|
68 | 66 | # MAGIC
|
|
236 | 234 | # MAGIC }
|
237 | 235 | # MAGIC
|
238 | 236 | # MAGIC def getWorkingDir(): String = {
|
239 |
| -# MAGIC val langType = "s" // for scala |
240 | 237 | # MAGIC val lessonName = getLessonName().replaceAll("[^a-zA-Z0-9]", "_")
|
241 | 238 | # MAGIC val moduleName = getModuleName().replaceAll("[^a-zA-Z0-9]", "_")
|
242 | 239 | # MAGIC val userhome = getUserhome()
|
243 |
| -# MAGIC return f"${userhome}/${moduleName}/${lessonName}/${langType}".replace("__", "_").replace("__", "_").replace("__", "_").replace("__", "_").toLowerCase() |
| 240 | +# MAGIC return f"${userhome}/dbacademy/${moduleName}/${lessonName}".replace("__", "_").replace("__", "_").replace("__", "_").replace("__", "_").toLowerCase() |
244 | 241 | # MAGIC }
|
245 | 242 | # MAGIC
|
246 | 243 | # MAGIC //**********************************
|
247 | 244 | # MAGIC // USER DATABASE FUNCTIONS
|
248 | 245 | # MAGIC //**********************************
|
249 | 246 | # MAGIC
|
250 | 247 | # MAGIC def getDatabaseName(username:String, moduleName:String, lessonName:String):String = {
|
251 |
| -# MAGIC val user = username.replaceAll("[^a-zA-Z0-9]", "") |
| 248 | +# MAGIC val user = username.replaceAll("[^a-zA-Z0-9]", "_") |
252 | 249 | # MAGIC val module = moduleName.replaceAll("[^a-zA-Z0-9]", "_")
|
253 | 250 | # MAGIC val lesson = lessonName.replaceAll("[^a-zA-Z0-9]", "_")
|
254 |
| -# MAGIC val langType = "scala" // for scala |
255 |
| -# MAGIC val databaseName = f"${user}_${module}_${lesson}_${langType}".toLowerCase |
| 251 | +# MAGIC val databaseName = f"dbacademy_${user}_${module}_${lesson}".toLowerCase |
256 | 252 | # MAGIC return databaseName
|
257 | 253 | # MAGIC }
|
258 | 254 | # MAGIC
|
|
0 commit comments